Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

How to hide all the XF templates and allow only specific XF templates to display while creating Experience fragments.

Avatar

Level 1

Hi
Trying to enable only specific XF templates to display while creating Experience fragments, and disable all other templates, how can this be achieved.
I have tried adding templates in the allowed templates property, still able to see all the templates. But i want to display only two templates which i have added in the allowed templates fields

user08015_0-1706622097916.png


Thanks,
Sai Kiran.




Topics

Topics help categorize Community content and increase your ability to discover relevant content.

7 Replies

Avatar

Community Advisor

@user08015 you need to add templates at /content/experience-fragments level..

 

Please refer to below community post for reference 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-create-experience-f...

Avatar

Level 1

Hi @Shashi_Mulugu 
I have added cq:allowedTemplates property on /content/experience-fragments node and /content/experience-fragment/test node. Along with the templates which I have added in the cq:allowedTemplates am able to see all the other template's. I want to display only the templates which I have allowed in the cq:allowedTemplates property, And I don't want other OOTB templates to be displayed while creating Experience fragments.

user08015_2-1706678962889.png


user08015_0-1706678060811.png
Thanks,
Sai kiran.

 

Avatar

Community Advisor

Hi @user08015 ,

Check in your /content/experience-fragments/ " path what is the allowed templates property and then further check in your child folder under this /content/experience-fragments/" path.
Allowed templates provided at child level takes precedence.

Thanks
Tarun

Avatar

Community Advisor

You need to all allowedPath in the XF template, wherever you want to allow
e.g. below template will only be available if you will be creating XF inside folder1 and within subfolder subfolder-name

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Template">
    <jcr:content
        cq:templateType="/conf/myproj/settings/wcm/template-types/empty-page-xf"
        jcr:primaryType="cq:PageContent"
        jcr:title="Demo XF Template"
        allowedPaths="[/content/experience-fragments/myproj/folder1/.*/.*/subfolder-name(/.*)?]"
        status="enabled"/>
</jcr:root>

 



Arun Patidar

Avatar

Level 1

Hi @arunpatidar,
Tried to add "allowedPaths" property in the template which I want to display while creating Experience fragments, But along with this required template able to see all the other templates.

user08015_0-1706866793339.png

Thanks,
Sai Kiran.

Avatar

Community Advisor

for other templates you can add allowedPaths as a generic path 

allowedPaths="[/content/experience-fragments/myproj/*]"

 



Arun Patidar

Avatar

Administrator

@user08015 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni