While creating an experience fragment,other templates (not only experience fragment) are also visible AEM 6.5

rahuldhingra

11-06-2020

While creating an experience fragment,other templates (not only experience fragment) are also visible when we set other templates (cq:allowedpaths) set to /content(/.*)? 

Is this product issue in AEM 6.5 or expected behaviour.

Note : I have added only experience fragments paths in cq:allowedtemplate property.

AEM 6.5 Experience Fragments

Accepted Solutions (1)

Accepted Solutions (1)

manising

11-06-2020

If you dont define cq:allowedTemplates at  /content/experience-fragments. then what AEM would do will list all the templates matching the regEx i.e. /content(/.*) . As experience-fragments is under /content, the regEx matches and the templates get displayed. The rendering logic can be found via this diagram

 

chlimage_1-176

Answers (3)

Answers (3)

vanegi

Employee

14-06-2020

Hello Rahul,

To make XF template available in the touch UI for creating experience fragments, you need to add experience fragment template in the allowed templates(cq:allowedTemplates = /conf/test-project/settings/wcm/templates/experience-fragment-web-variation) instead of allowedPaths on the /content/experience-fragments/<project>.

 

vanegi_0-1592145857564.png

 


And then when you go to AEM start screen, http://localhost:4504/aem/start.html, click experience fragment then select the test-project folder and click create, XF template is available for selection. 

 

 

Thanks,

Vaishali

berliant

Employee

11-06-2020

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 Sring[] and set all available templates there, example:

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

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

surabhikatiyar

Employee

11-06-2020

As I can check in the Adobe documentation, it is mentioned that combining both cq:allowedTemplates and allowedPaths is not recommended and only cq:allowedTemplates should be used. combining them can lead to very complex rules that are difficult to track and manage.

Also, in AEM 6.4.3 combination of both was working but it was a product bug and that has been corrected in AEM 6.4.4 and now it is only recommended to use cq:allowedTemplates

For more information on this please check the below document also:

https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/templates.html#main-pars_title...

So, I would now recommend you to please use the cq:allowedTemplate property on the folder level as this is Adobe recommended property.