Skip to main content
sandeepv3925327
Mar 27, 2019 3:21 PM UTC

Page properties inheritance

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

smacdonald2008
Level 10
Mar 27, 2019 3:35 PM UTC

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.

Translate
arunpatidar
Community Advisor
Community Advisor
Mar 27, 2019 4:15 PM UTC

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.

Translate
Arun Patidar
manikanthar1295
Level 5
May 2, 2022 3:51 PM UTC

Hi Arun,

 

Can u share code how to get the inherited property for page.

Translate
Gaurav-Behl
Level 10
Mar 27, 2019 4:52 PM UTC

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

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

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

HTL Global Objects

Translate