Setting up defult page property for pages created from specific template | Community
Skip to main content
Level 3
March 13, 2023

Setting up defult page property for pages created from specific template

  • March 13, 2023
  • 4 replies
  • 961 views

Hi,
I have a template, which has a custom boolean property hideBreadcrumb checked by admin. Now, I'm creating new pages using template programatically. I want all the pages created from template to have hideBreadcrumb property checked by default. Do I need to add any configuration for this? My template property is currently checked but pages created from the template don't have hideBreadcrumb checked. Thanks in advance!

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

4 replies

SivakumarKanoori
Community Advisor
Community Advisor
March 14, 2023

@aembee :

if you make any changes to the existing template(adding any property or value) , that will applicable for the pages we create later.

same will not affect on the existing pages. so you can do any of the below.

 

1) if you need to check that property programmatically , in your logic try to check that property, if property doesn't exist , treat that as by default true.

2) if you need that value has to be present at the page level , then you can update that property programmatically by developing Sling servlet or Groovy script .

(Query out all the pages which are created by template , and try to iterate and add the property.)

 

Thanks,

Siva

Thanks,Siva
Rohan_Garg
Community Advisor
Community Advisor
March 14, 2023

@aembee - If your template is an Editable Template, then the custom property can be defined as template level configuration. The policies will all end up residing in a single .content.xml file.

 

Please refer to the below documentation link -

https://experienceleague.adobe.com/docs/experience-manager-65/developing/platform/templates/page-templates-editable.html?lang=en

 

 

You can also refer to the below blog for the same -

https://www.hoodoo.digital/blog/organizing-content-policies-in-aem

arunpatidar
Community Advisor
Community Advisor
March 14, 2023
aembeeAuthor
Level 3
March 14, 2023

Thanks Everyone! I noticed one thing. If I create the new pages manually using same template, hideBreadcrumb property is checked but if the pages are created programatically from JAVA, hideBreadcrumb is not checked by default, although template has that property checked.