Expand my Community achievements bar.

SOLVED

cq:AllowedTemplates not updated for existing pages

Avatar

Level 2

Hi, 

I have noticed the following problem :

When we create a new page, the property “cq:allowedTemplates” with value from the template definition is created.

If the value of the property changes in template definitions, pages which are already created are not updated.

Do we have a solution for this?

We are using AEM 6.3 version

Thanks

Souvik

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi Souvik,

I think once the page is created from static template you can't update structure/properties.

You may need to write utility to update cq:allowedTemplates property in page.

You can take a reference from below tool, you can create something like GUI tool below or just use Node API to update properties

Resource Type/Template Updater

Thanks

Arun



Arun Patidar

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi Souvik,

I think once the page is created from static template you can't update structure/properties.

You may need to write utility to update cq:allowedTemplates property in page.

You can take a reference from below tool, you can create something like GUI tool below or just use Node API to update properties

Resource Type/Template Updater

Thanks

Arun



Arun Patidar

Avatar

Level 1

Thank you for your response.

What about dynamic (editable) templates? How can we modify the list of allowed child templates for existing pages if they were created via Editable templates?

Best regards,

Ivan

Avatar

Community Advisor

Hi,

you can add allowedChildren property in template and value is regular expression patterns to determine the path(s) to templates allowed as child templates.

e.g. I added allowedChildren= /conf/we-retail/settings/wcm/templates/hero-page in product-page template,

/conf/we-retail/settings/wcm/templates/product-page

Screen Shot 2018-06-10 at 8.46.17 AM.png



Arun Patidar