简体   繁体   中英

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]

你刚刚错误地将命令误写为并且没有¨&&“。它不会在TS-Parser中引发错误吗?你可以从administartion面板中的网站查看渲染过程。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM