打字稿:AND(&&)在不工作的情况下
我有以下打字稿,
[PIDinRootline=6,7,11]
//do somehting
[end]
[PIDinRootline=6,7,11] && [globalVar = TSFE:id=1]
// do something else
[global]
我只能从 [PIDinRootline=6,7,11]
获得结果。我的&&条件在这里不起作用。我做错了什么?
解决方案:
我认为已经晚了,我只复制并粘贴了代码。我想做的是查询某个页面ID和某种语言。这是解决方案:
[PIDinRootline=6,7,11]
//do somehting
[end]
[PIDinRootline=6,7,11] AND [globalVar = GP:L=1]
// do something else
[end]
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]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
[globalVar = TSFE:id=1]
表示:恰好在此页面上。因此,您可能需要使用OR
,因为当假设 PID 1 高于 6、7 和 11 时,这两个条件不能同时满足,如本页树示例所示:另外,您可以使用模板模块中的typoscript对象浏览器用于调试typoscript。更多选项此处描述。
[globalVar = TSFE:id=1]
means: Exactly on this page. Therefore you might need to useOR
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:Also, you can use the typoscript object browser in the Template module to debug typoscript. More options described here.
你只是拼错了命令,它写成“AND”,而不是“&&”。它不是在 TS-Parser 中抛出错误吗?你可以在管理面板中的网站上查看渲染过程。
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.