Typo3 > 9.4 - Typoscript 中的嵌套条件可用吗?

问题描述 投票:0回答:2

有谁知道 Typo3>9.4 中是否可以嵌套条件?

我在互联网或网站本身的文档中没有找到任何内容。

目前我尝试这样:

[2 in tree.rootLineIds]
  [applicationContext == "Development"]
    [loginUser('*') && page["uid"] in [13]]
      ....
    [end]
  [end]
[end]

但是好像不行。有人给我提示吗?我将非常感激。

nested conditional-statements typo3 typoscript typo3-9.x
2个回答
1
投票

在我看来,TS 条件的嵌套仍然是不可能的(在文档中没有找到任何有关它的信息 - 它既不起作用也不起作用)。

也许结合条件可以帮助你。


0
投票

自 TYPO3 v12 起,可以进行基本嵌套,请参阅 https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Configuration/TypoScript/Syntax/FileImports/Index.html

但每个文件只能嵌套一层。示例:

[frontend.user.isLoggedIn]
    @import './userIsLoggedIn.typoscript'
[END]

在文件

userIsLoggedIn.typoscript
中,您也可以使用TypoScript条件。因此,存在第二层嵌套。

© www.soinside.com 2019 - 2024. All rights reserved.