Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Adding default values to page properties using editable templates

Avatar

Level 2

We have arequirement to add custom flags to pages created using a particular editable template ,using static template we could do this by adding the property under template/ jc:content  .Please let me how to achieve the same using editable templates.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@krishker  There is no format such that, it takes the name attribute of your custom property.
For Eg: 

krishna_sai_0-1677472951563.png

you have a text field with ./sampleProperty 

Navigate to initial content of your template node and save that custom property with the value you want to come as part of page creation with this template

krishna_sai_1-1677473131980.png

Now when you create a page using this template you can see that value you have given in the page properties.
Hope this helps,
Krishna

 

 

View solution in original post

7 Replies

Avatar

Community Advisor

@krishker you can add properties to initial/jcr:content node if you want any properties that needs to come as part of page creation.

Eg: /conf/we-retail/settings/wcm/templates/content-page/initial/jcr:content


Hope this helps,

Krishna

Avatar

Level 2

Hello Sai..

Thanks for the response . This is what I tried but the values are not shown in the newly created pages . Do we have a format to add the properties like jcr:xxx or cq:xxx . (Trying this in my local instance) .

 

Thanks 

Krishna

Avatar

Correct answer by
Community Advisor

@krishker  There is no format such that, it takes the name attribute of your custom property.
For Eg: 

krishna_sai_0-1677472951563.png

you have a text field with ./sampleProperty 

Navigate to initial content of your template node and save that custom property with the value you want to come as part of page creation with this template

krishna_sai_1-1677473131980.png

Now when you create a page using this template you can see that value you have given in the page properties.
Hope this helps,
Krishna

 

 

Avatar

Level 4

You can overlay or override the properties in your template and then you can provide the default values to the properties.

Thanks

Shivam

Avatar

Level 2

Hello Shivam ,

Thsnka for the response. My requierement is for custom properties , which i need to add on page creation based on templates.

 

Regards

Krishna