allowedTemplates property is not working as expected (Experience Fragment) | Community
Skip to main content
Level 5
Aug 25, 2020 1:36 AM UTC
Solved

allowedTemplates property is not working as expected (Experience Fragment)

Hello Community - It looks like cq:allowedTemplates is not working in 6.5.x as expected. We are trying to restrict the templates for experience fragments. Tried updating the property in /content/experience-fragments folder but no luck. We see all static templates as well after updating the property. We just wanted to restrict all other templates while creating experience fragments. Can someone assist on this issue?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
vish.dhaliwalAccepted solution
Employee
Aug 25, 2020 1:42 AM UTC

Hello,

 

You should set property inside /content/experience-fragments/<customer_folder>/cq:allowedTemplates instead of /content/experience-fragments/, otherwise the values will get overridden on SP upgrade.

Check section "Creating and Configuring a Folder for your Experience Fragments" here [1]

[1] https://docs.adobe.com/content/help/en/experience-manager-64/authoring/authoring/experience-fragments.html#configure-allowed-templates-instance

Regards,

Vishu

9 replies

vanegi
Employee
Aug 25, 2020 7:43 AM UTC

Hello @v1101,

Allowed templates for experienced fragments should be set for XF root folder, for example at /content/experience-fragments.

You need to define cq:allowedTemplates property as String[] and set all available templates there, example:

/libs/cq/experience-fragments/components/experiencefragment/template

/conf/we-retail/settings/wcm/templates/experience-fragment(.*)?

 

You need to add experience fragment template in the allowed templates (cq:allowedTemplates = /conf/test-project/settings/wcm/templates/experience-fragment) instead of allowedPaths on the /content/experience-fragments/<project>.

 

Thanks!!

Translate
vish.dhaliwalAccepted solution
Employee
Aug 25, 2020 1:42 AM UTC

Hello,

 

You should set property inside /content/experience-fragments/<customer_folder>/cq:allowedTemplates instead of /content/experience-fragments/, otherwise the values will get overridden on SP upgrade.

Check section "Creating and Configuring a Folder for your Experience Fragments" here [1]

[1] https://docs.adobe.com/content/help/en/experience-manager-64/authoring/authoring/experience-fragments.html#configure-allowed-templates-instance

Regards,

Vishu

Translate
v1101Author
Level 5
Aug 25, 2020 2:09 AM UTC
@vish.dhaliwal - Thanks for the inputs.I have already tried this suggestion but it is not working. Do you think of any other solution ?
Translate