Allow Template to be used in different Sites | Community
Skip to main content
New Participant
October 14, 2022
Solved

Allow Template to be used in different Sites

  • October 14, 2022
  • 2 replies
  • 639 views

I have created templates in different site folder and wanted to use it on another site of folder which property I have to use Do i have to add property in template or a page?.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi,

You need to add a property to root where you want to allow those templates

Example

 

cq:allowedTemplates="[/conf/(.*)/settings/wcm/templates/experience-fragment(.*)?,/conf/(.*)/settings/wcm/templates/xf(.*)?]" 

Or

cq:allowedTemplates="[/conf/wknd/settings/wcm/templates/landing-page-template,/conf/wknd/settings/wcm/templates/article-page-template,/conf/wknd/settings/wcm/templates/content-page-template,/conf/wknd/settings/wcm/templates/adventure-page-template]"

 

https://github.com/adobe/aem-guides-wknd/blob/4d678ee8079c86be639036f7747f8201a434aa97/ui.content/src/main/content/jcr_root/content/wknd/.content.xml 

2 replies

arunpatidar
arunpatidarAccepted solution
New Participant
October 14, 2022

Hi,

You need to add a property to root where you want to allow those templates

Example

 

cq:allowedTemplates="[/conf/(.*)/settings/wcm/templates/experience-fragment(.*)?,/conf/(.*)/settings/wcm/templates/xf(.*)?]" 

Or

cq:allowedTemplates="[/conf/wknd/settings/wcm/templates/landing-page-template,/conf/wknd/settings/wcm/templates/article-page-template,/conf/wknd/settings/wcm/templates/content-page-template,/conf/wknd/settings/wcm/templates/adventure-page-template]"

 

https://github.com/adobe/aem-guides-wknd/blob/4d678ee8079c86be639036f7747f8201a434aa97/ui.content/src/main/content/jcr_root/content/wknd/.content.xml 

Arun Patidar
HeenaMadan
New Participant
October 14, 2022

You can add template path in Allow Template properties of your site hierarchy root page

 

Click on Site hierarchy-> Click Properties -> Go to Advance tab-> Go to Template Setting Section-> Allowed Templates -> <Add path of the different folder which you wanna use>

Save and close

Then Click create page. You can see template(added above).