Expand my Community achievements bar.

SOLVED

Template allowed paths in AEM

Avatar

Level 2

Hi Guys,

We have a template A which can be used anywhere with allowed path /content/project/en(/.*)?
but it should not be allowed in /content/project/en/xyz/abc/
Please help me to figure this out guys.

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can override it by the property cq:allowedTemplates in /content/project/en/xyz/abc/

So, it first checks for cq:allowedTemplates and if it doesnt have that, then it looks out for cq:allowedPaths.

View solution in original post

4 Replies

Avatar

Level 10

This is an interesting use case. If you specify this value for allowedPaths:

/content/project/en/[^/]+(/.*)?

Not sure if there  is a way to exclude:

 content/project/en/xyz/abc/

(if there is - its not documented)

There is no property named disallowPaths of type String[].

Avatar

Correct answer by
Level 10

You can override it by the property cq:allowedTemplates in /content/project/en/xyz/abc/

So, it first checks for cq:allowedTemplates and if it doesnt have that, then it looks out for cq:allowedPaths.

Avatar

Level 1

You can also use cq:allowedPath property on the template

^(?!/content/project/en/xyz/abc?:/|$))/content/*(/.*)

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

Avatar

Community Advisor

Please try to replace allowed path /content/project/en(/.*)? with /content/project/en(/(?!xyz/abc/).*)?  .



Arun Patidar