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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Page properties inheritance

sandeepv3925327
Level 1
Level 1

Suppose i have one product page in which i created one page properties ex: Country Code, i set that value to "US".

So how can we achieve inheritance so child pages under product page having same value of Country Code i.e "US"

As i am not able to achieve inheritance of page properties to its child pages.

Thanks in Advance for Support

3 Replies
smacdonald2008
Level 10
Level 10

You can look at writing a JCR event handler. When child page is created, the event handler can fire and add a prop to meet your requirement.

Arun_Patidar
Community Advisor
Community Advisor

Hi,

You can do it using sling model or WCMUsePojo.

1. check current page properties, if present use it otherwise look for parent page.

2. in parent page look for same property if present use it otherwise look for its parent page.

3. repeat step 2 until you found either the property or root page of site/sub-site.

Hope this help.

Gaurav-Behl
Community Advisor
Community Advisor

Won't  "inheritedPageProperties" or "HierarchyNodeInheritanceValueMap" work for this?

com.day.cq.commons.inherit.InheritanceValueMap;

com.day.cq.commons.inherit.HierarchyNodeInheritanceValueMap;

HTL Global Objects