Template allowed paths in AEM | Community
Skip to main content
jacob_m1
Level 2
November 18, 2015
Solved

Template allowed paths in AEM

  • November 18, 2015
  • 4 replies
  • 18481 views

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.

Best answer by Lokesh_Shivalingaiah

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

smacdonald2008
Level 10
November 18, 2015

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

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
November 18, 2015

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.

kumar3445
January 18, 2018

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.

arunpatidar
Community Advisor
Community Advisor
January 18, 2018

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

Arun Patidar