Page properties inheritance

Avatar

Avatar

sandeepv3925327

Avatar

sandeepv3925327

sandeepv3925327

27-03-2019

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

Replies

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

27-03-2019

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.

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

883

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

883
Arun_Patidar
MVP

27-03-2019

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.

Avatar

Avatar

Gaurav-Behl

MVP

Avatar

Gaurav-Behl

MVP

Gaurav-Behl
MVP

27-03-2019

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

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

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

HTL Global Objects