Expand my Community achievements bar.

SOLVED

allowedPaths and allowedParents,allowedChildren in editable Templates

Avatar

Level 2

Hi,

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

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

@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]"

View solution in original post

2 Replies

Avatar

Community Advisor

 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

 

Screen Shot 2024-02-27 at 9.38.23 PM.png

Avatar

Correct answer by
Level 10

@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]"