Expand my Community achievements bar.

cq:allowedTemplates is not working with experience fragment in AEM 6.4.8

Avatar

Level 4

I see all my static templates while creating experience fragment. Checked the property cq:allowedTemplates on /content/experience-fragments, it contains

 

/libs/cq/experience-fragments/components/experiencefragment/template
/libs/settings/screens/experience-fragments/templates/experience-fragment-template-screens
/conf/we-retail-screens/settings/wcm/templates/experience-fragment-screens-variation
/conf/we-retail/settings/wcm/templates/experience-fragment(.*)?

 

Only conf and libs templates should be shown while creating template as per the above config but I am seeing all the static template that resides inside /apps folder. Basically I would want to stop showing static templates that resides on /apps folder. Is there any other config to make this happen?

5 Replies

Avatar

Community Advisor

Hi,

Try to use allowedPath property-

 

EM offers multiple properties to control the templates allowed under Sites . However, combining them can lead to very complex rules that are difficult to track and manage.
Therefore, Adobe recommends that you start simple, by defining:
  • only the cq:allowedTemplates property
  • only on the site root
For an example, see We.Retail: /content/we-retail/jcr:content
The properties allowedPaths , allowedParents , and allowedChildren can also be placed on the templates to define more sophisticated rules. However, when possible, it is much simpler to define further cq:allowedTemplates properties on sub-sections of the site if there is a need to further restrict the allowed templates.
An additional advantage is that the cq:allowedTemplates properties can be updated by an author in the Advanced tab of the Page Properties . The other template properties cannot be updated using the (standard) UI, so would need a developer to maintain the rules and a code deployment for every change.

Avatar

Level 4

Thanks for your reply. allowedPath is not working at /content/experience-fragments level but it worked when I change regulr expression at the static tempalte level. making this change at 20+ template may not be a correct approach. Why cq:allowedTemplates & allowedPath  props are not working at ef level? Is this a bug?

Avatar

Level 5

@Anderson_Hamer - I am also facing the similar issue. Can you please let me know if making the changes at static template level fix the issues with the allowed Templates policy at /content/experience-fragments level? if so, can you tell me what should I use in static template allowedPath (Regular Expression)?

Avatar

Level 4

Yes, change allowedPaths value from /content(/.*)? to /content(yourProjectarea)? 

Avatar

Community Advisor

I guess it is a product bug. Issue exists since 6.4.4. Adobe had made some changes in 6.4.4 as per SP release notes and it would have impacted.
https://docs.adobe.com/content/help/en/experience-manager-64/release-notes/sp-release-notes.html
Ideally it should show only the XF templates which is configured in cq:allowedTemplates not the static page templates which is mentioned with allowedPaths-String-/content(/.*)? property