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!
Views
Replies
Total Likes
@prachiz :
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
@prachiz - 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 -
You can also refer to the below blog for the same -
https://www.hoodoo.digital/blog/organizing-content-policies-in-aem
you need to add this in initial node.
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.