ak85
ak85

Reputation: 4264

apply template to current page not children

I know about ext templates and the option where you can select the Template on Next Level:

However I just want to add something to one page only (not the children) and I think it would be a bit of a waste to have to make an ext template then another one for the children so I am trying to use some conditions. see this link for details.

If I do the below

[PIDinRootline = 10]
...
[end]

it works but also includes children.

I have tried the below but it doesn't seem to work?

[PIDinRootline = 10 && treeLevel = 1]
...
[end]

Any ideas on the best way to approach this?

Upvotes: 0

Views: 564

Answers (1)

biesior
biesior

Reputation: 55798

Use condition:

[globalVar = TSFE:id = 10]
    ...
[end]

for exact targeting page's uids

additionally you can use operators such as || (OR) or && (AND) for more sophisticated combinations, ie:

[globalVar = TSFE:id = 10] || [globalVar = TSFE:id = 978]

It will work on pages with uid: 10 OR 978

Upvotes: 2

Related Questions