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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

How to inherit custom page properties on child pages?

Avatar

Level 3

I have three template. All page are inherited from a root named page

  1. Homepage template
  2. Content page template
  3. Search page template

And Content structure is

  • home-page-template
    • content-page-template-1
      • content-page-template-1.1
      • content-page-template-1.2
        • content-page-template-1.2.1
      • ....
    • search-page-template
      • .....
    • ........

I have added a custom tab on page dialog with two path browser. I want to configure it on home-age template and needs to inherit it on all child level templates pages.

 

  • home-page-properties
    • custom-prop-1 = abc
  • this property needs to be inherited on all child level different pages. How to achieve this?
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

You can use inheritedPageProperties  global object in slightly/java to read page properties from parent pages.

Please check below article from @BrianKasingli 

https://sourcedcode.com/blog/aem/aem-quick-reference/aem-inheritedpageproperties-with-sightly-jsp-os... 

View solution in original post

5 Replies

Avatar

Community Advisor

@kaikubad what is the purpose of the custom property you're using in page properties?

Are you going to do something on the page level by using the property? 

please share more details.

 

Avatar

Level 3

Sorry can not share the bussiness logic here. But thats the requirement i wrote. Please help if you know how to achieve the requirement

Avatar

Community Advisor

no issues, i don't want you share the business logic here 🙂 

As i understood, i don't think there is an OOTB solution for this, you need to look for custom solutions. 

Avatar

Correct answer by
Community Advisor

Hi,

You can use inheritedPageProperties  global object in slightly/java to read page properties from parent pages.

Please check below article from @BrianKasingli 

https://sourcedcode.com/blog/aem/aem-quick-reference/aem-inheritedpageproperties-with-sightly-jsp-os... 

Avatar

Community Advisor

@kaikubad  try below solution if this works

@Inject
private InheritanceValueMap pageProperties;
 pageProperties.getInherited("propName", StringUtils.EMPTY)

 

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now