testing
testing

Reputation: 20289

Typoscript: AND (&&) in condition not working

I have the following typoscript

[PIDinRootline=6,7,11]
    //do somehting
[end]

[PIDinRootline=6,7,11] && [globalVar = TSFE:id=1]
    // do something else
[global]

I only get the result from [PIDinRootline=6,7,11]. My && condition is not working here. What I'm doing wrong?

Solution:

I think it was late and I only copy and pasted the code. What I wanted to do is to query on a certain page ID and a certain language. This is the solution:

[PIDinRootline=6,7,11]
    //do somehting
[end]

[PIDinRootline=6,7,11] AND [globalVar = GP:L=1]
    // do something else
[end]

Upvotes: 0

Views: 4110

Answers (2)

Mateng
Mateng

Reputation: 3734

[globalVar = TSFE:id=1] means: Exactly on this page. Therefore you might need to use OR because both conditions cannot be met at the same time, when assuming that PID 1 is above 6, 7 and 11, like in this page tree example:

1 ---
- 5 -
- 6 -
- 7 -
- 9 -
- 11-

2 ---
- 3 -
- 4 -

Also, you can use the typoscript object browser in the Template module to debug typoscript. More options described here.

Upvotes: 1

Cybercartel
Cybercartel

Reputation: 12592

You have just mispell the command its written AND and not ¨&&". Didn't it throw an error in the TS-Parser? You can look at the rendering process from the website in the administartion panel.

Upvotes: 1

Related Questions