Typoscript 条件:backend_layout(带幻灯片)

Typoscript Condition: backend_layout (with slide)

我用这个条件

[globalVar = GP:colPos==0]&&[page|backend_layout = pagets__MainTemplate]

我的问题是我的“子页面”没有 backend_layout 选择,因为设置了父页面“后端布局(此页面的子页面)”。因此条件不适用于子页面。

能创造这样的条件吗?

lib.backendLayout = TEXT
lib.backendLayout {
    data = levelfield:-1, backend_layout_next_level, slide
    override.data = TSFE:page|backend_layout
}

我想以这种方式在 BE 列中执行 white/blacklist CTypes:

[globalVar = GP:colPos==0]&&[page|backend_layout = pagets__MainTemplate]
    TCEFORM.tt_content.CType.keepItems := addToList(header)
[end]

据我所知不是,因为你只能访问当前页面记录 "page" 条件。

相反,你可以

a) 写下你自己的条件(见https://docs.typo3.org/typo3cms/TyposcriptReference/8.7/Conditions/Reference/Index.html#custom-conditions or starting with version 9 https://docs.typo3.org/typo3cms/TyposcriptReference/Conditions/Reference.html#extending-the-expression-language-with-own-functions-like-old-userfunc

b) 使用 userFunc(像 "a" 一样,只是更旧且不那么花哨;))- 参见 https://docs.typo3.org/typo3cms/TyposcriptReference/8.7/Conditions/Reference/Index.html#userfunc

新 c) 遵循 Jigals 的建议(或使用类似的扩展 - 有一些 - 但它们大多做的比你需要的要多得多)

--- 问题更新后编辑 ---

如您所愿,它在 TSConfig c) 中工作实际上不是一个选项。

c) 取决于您实际想要通过您的条件实现的目标,如果您的条件为真,则直接在 TS 对象上使用 if 和数据(如您的描述),这些对象应该具有不同的行为。

供参考:

TSConfig条件与TS条件的区别: https://docs.typo3.org/typo3cms/TSconfigReference/8.7/Conditions/Index.html#differences-to-conditions-in-typoscript-templates

作为 Susi 解决方案的替代方案,您可以使用 Gridelements。此扩展的功能是您可以在允许 CE 的后端布局中的每个块内进行设置。