Facing issue with InheritanceValueMap
Hello Team,
I have a page property: isMyPage of Type: String
This page property is enabled/ disabled in language node.
Ex: /content/abc/xyz/fr/en, /content/abc/xyz/fr/fr, Ex: /content/abc/xyz/gb/en
I have written logic in my custom sling model.
@ScriptVariable private Page currentPage;
private InheritanceValueMap inheritanceValueMap;
void init(){
inheritanceValueMap =
Optional.ofNullable(currentPage.getContentResource())
.map(resource -> resource.adaptTo(HierarchyNodeInheritanceValueMap.class))
.orElseGet(
() -> new HierarchyNodeInheritanceValueMap(currentPage.getContentResource()));
if (inheritanceValueMap != null) {
Boolean inheritedValue =
inheritanceValueMap.getInherited("isMyPage", Boolean.FALSE);
}
}
I have enabled the property in these pages
/content/abc/xyz/fr/en,
/content/abc/xyz/gb/en
This works for, when i open the page:
http://localhost:4502/content/abc/xyz/fr/en/home/support
value of inheritedValue is true.
http://localhost:4502/content/abc/xyz/gb/en/home/support
value of inheritedValue is false.
Not sure, why I am getting false in above case.
Thanks
cc @arunpatidar @lukasz-m @sureshdhulipudi