Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Facing issue with InheritanceValueMap

Avatar

Level 9

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 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

For this path: /content/abc/xyz/gb/en/home/support

Have you checked in CRX if the isMyPage property for the home or support page is set to false?

The logic works as follows:

  • If isMyPage is not found, the system will retrieve data from the nearest parent.
  • If isMyPage is explicitly set (either in home or support), it will pick the closest available data instead.

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

For this path: /content/abc/xyz/gb/en/home/support

Have you checked in CRX if the isMyPage property for the home or support page is set to false?

The logic works as follows:

  • If isMyPage is not found, the system will retrieve data from the nearest parent.
  • If isMyPage is explicitly set (either in home or support), it will pick the closest available data instead.

Avatar

Level 9

Hi @Sady_Rifat 

 

My bad   By mistake, property was present in home page. Now, I have removed that one. Now, feature works fine.

 

Thanks a lot for your quick help.

Avatar

Community Advisor