allowedPaths and allowedParents,allowedChildren in editable Templates | Community
Skip to main content
Level 2
February 28, 2024
Solved

allowedPaths and allowedParents,allowedChildren in editable Templates

  • February 28, 2024
  • 2 replies
  • 2097 views

Hi,

do these properties allowedPaths and allowedParents,allowedChildren work on editable templates? If so, how do we use them in editable templates.

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 Imran Khan

@sindhusr 

You can also use cq:allowedPaths property on the template

So your template will not be found while you create pages under /content/project/en/xyz/abc.

allowedPaths="[/content/entities(/.*)?]"

 

On the content the template must be allowed (using the cq:allowedTemplates property as show below

cq:allowedTemplates="[/conf/practice/settings/wcm/templates/(?!xf-).*]"

allowedParents
Regular expression patterns to determine the path(s) of components that are allowed as parent components.

allowedParents="[/apps/powerade/templates/homepage, /apps/powerade/templates/contentpage]" (don't work)

 allowedChildren
Regular expression patterns to determine the path(s) of components that are allowed as child components.

Within CRX/DE under /conf/my-site/settings/wcm/templates/templateA (should be a cq:Template), add the property of String[] allowedChildren to "PATH_OF_YOUR_TEMPLATE". The value set should be the paths of a template that is allowed to be a child of this template. 

allowedChildren="[/apps/powerade/templates/contentpage]"

2 replies

SureshDhulipudi
Community Advisor
Community Advisor
February 28, 2024

 allowedPaths will work with Editable templates.

The allowedPaths property is not directly available in the page policy of an editable template in AEM. The control of where an editable template can be used is typically managed through the template's cq:allowedTemplates property on the page component.

 

You can configure in your Page / content root page properties Advanced Tab

 

Imran Khan
Community Advisor
Imran KhanCommunity AdvisorAccepted solution
Community Advisor
February 28, 2024

@sindhusr 

You can also use cq:allowedPaths property on the template

So your template will not be found while you create pages under /content/project/en/xyz/abc.

allowedPaths="[/content/entities(/.*)?]"

 

On the content the template must be allowed (using the cq:allowedTemplates property as show below

cq:allowedTemplates="[/conf/practice/settings/wcm/templates/(?!xf-).*]"

allowedParents
Regular expression patterns to determine the path(s) of components that are allowed as parent components.

allowedParents="[/apps/powerade/templates/homepage, /apps/powerade/templates/contentpage]" (don't work)

 allowedChildren
Regular expression patterns to determine the path(s) of components that are allowed as child components.

Within CRX/DE under /conf/my-site/settings/wcm/templates/templateA (should be a cq:Template), add the property of String[] allowedChildren to "PATH_OF_YOUR_TEMPLATE". The value set should be the paths of a template that is allowed to be a child of this template. 

allowedChildren="[/apps/powerade/templates/contentpage]"