Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

inheritedPageProperties not available at all child levels

Avatar

Avatar
Validate 1
Level 1
volgadr10
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
volgadr10
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
volgadr10
Level 1

07-02-2021

I am facing an issue where my custom added property is available to direct children but not grandchildren. For example, I have a property showTitle and its value is set on page 1 and is available on page1.1 but not available on page 1.1.1. I need it to be available in all subpages of the page1. Any ideas on how to achieve that.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
Level 7
KiranVedantam1992
Level 7

Likes

169 likes

Total Posts

175 posts

Correct Reply

54 solutions
Top badges earned
Springboard
Give Back 5
Ignite 1
Affirm 50
Validate 1
View profile

Avatar
Springboard
Level 7
KiranVedantam1992
Level 7

Likes

169 likes

Total Posts

175 posts

Correct Reply

54 solutions
Top badges earned
Springboard
Give Back 5
Ignite 1
Affirm 50
Validate 1
View profile
KiranVedantam1992
Level 7

07-02-2021

Hi @volgadr10,

 

You can access inheritedPageProperties in different ways:

  1. Sightly: ${inheritedPageProperties.myCustomProperty}
  2. Java: InheritanceValueMap 
    1. Definition as per the documentation: The InheritanceValueMap is an extension of the ValueMap which allows taking the hierarchy of resources into account while looking for properties. As such, if a property is not found on the current resource, it will be looked upon by its parent and so on. The exact inheritance mechanism depends on the implementation.
    2. Sample Code:
      1. @ScriptVariable
        private Page currentPage;
        InheritanceValueMap ivm = new HierarchyNodeInheritanceValueMap(currentPage.getContentResource());
        String inheritedValueMyCustomProperty = ivm.getInherited("myCustomerProperty"String.class);
  3. If it is JSP you can use the same way as Java.

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

Answers (0)