There are many ways inheritance is implemented in AEM. For today’s topic, we would be discussing a couple of use-cases on how to access the properties from either ancestral pages or components
Accessing a page property that is authored on the home page into its child pages using java code.
An InheritanceValueMap for a given page resource that will inherit values from ancestral pages.
On my /content/allaem/us/en page, I have added a property
A new object is created for HierarchyNodeInheritanceValueMap and current page content resource is passed into it as a parameter.
Here, the InheritanceValueMap checks for “jcr:description” in
If the property is found nowhere, null is returned.
This model is now referenced in the text component’s htl in the below way