Adding default values to page properties using editable templates | Community
Skip to main content
February 24, 2023
Solved

Adding default values to page properties using editable templates

  • February 24, 2023
  • 3 replies
  • 2274 views

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.

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

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

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

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

 

 

3 replies

cwalter-1
February 24, 2023
krishna_sai
Community Advisor
Community Advisor
February 24, 2023

@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

krishkerAuthor
February 27, 2023

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

krishna_sai
Community Advisor
krishna_saiCommunity AdvisorAccepted solution
Community Advisor
February 27, 2023

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

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

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

 

 

Shivam153
February 26, 2023

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

Thanks

Shivam

krishkerAuthor
February 27, 2023

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