How to inherit custom page properties on child pages? | Community
Skip to main content
kaikubad
New Participant
Nov 1, 2022 6:46 AM UTC
Solved

How to inherit custom page properties on child pages?

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?
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Nov 1, 2022 10:05 AM UTC

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-osgi-bundle 

Arun Patidar

5 replies

Jagadeesh_Prakash
New Participant
Nov 1, 2022 10:30 AM UTC

@kaikubad  try below solution if this works

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

 

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Nov 1, 2022 10:05 AM UTC

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-osgi-bundle 

Translate
Arun Patidar
Siva_Sogalapalli
New Participant
Nov 1, 2022 7:41 AM UTC

@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.

 

Translate
kaikubad
kaikubadAuthor
New Participant
Nov 1, 2022 7:45 AM UTC

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

Translate
Siva_Sogalapalli
New Participant
Nov 1, 2022 8:11 AM UTC

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. 

Translate