Template allowed paths in AEM | Community
Skip to main content
jacob_m1
Level 2
Nov 18, 2015 5:06 PM UTC
Solved

Template allowed paths in AEM

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.

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
Nov 18, 2015 6:54 PM UTC

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.

4 replies

arunpatidar
New Participant
Jan 18, 2018 1:09 PM UTC

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

Translate
Arun Patidar
kumar3445
New Participant
Jan 18, 2018 12:01 AM UTC

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.

Translate
Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
Nov 18, 2015 6:54 PM UTC

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.

Translate
smacdonald2008
Level 10
Nov 18, 2015 6:53 PM UTC

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[].

Translate