2

我将 TYPO3 从 7.6 升级到 8.6。现在我无法通过 style.content.get 设置变量,我的根模板加载了 fluid_styled_content。一些来源:

page.10 = FLUIDTEMPLATE
page.10 {
    partialRootPath ={$resDir}/Private/Partials
    layoutRootPath = {$resDir}/Private/Layouts

   variables {
        contentMain < styles.content.get
        contentMain.select.where = colPos = 0
        contentnew < styles.content.get
        contentnew.select.where = colPos = 1
        contentkat < styles.content.get
        contentkat.select.where = colPos = 2

        test = TEXT
        test.value = loool
    }
}

显示变量:

<f:format.raw> {contentMain} </f:format.raw>
<f:format.raw> {contentnew} </f:format.raw>
<f:format.raw> {contentkat} </f:format.raw>
<f:format.raw> {test} </f:format.raw>
4

3 回答 3

2

styles.content.get在 ext:fluid_styled_content 中定义但很晚,所以大多数副本都是空的。引用不是解决方案,因为 colPos 的修改将适用于所有引用。

目前最好的解决方案似乎是在你的 TS 早期定义 styles.content.get :

styles.content.get = CONTENT 
styles.content.get {
    table = tt_content
    select {
        orderBy = sorting
        where = colPos=0
    }
}

但由于它是一个自己的定义,我会将其重命名为,temp.content.get因此它可以识别为我自己的版本(如果全局定义发生变化,不会造成混淆)

于 2017-02-24T06:56:33.510 回答
2

TYPO3 8.6 中有一个错误:https ://forge.typo3.org/issues/80044

在分配styles.content.get给您之前添加它variables <INCLUDE_TYPOSCRIPT: source="FILE:EXT:frontend/ext_typoscript_setup.txt"> 然后您可以像以前一样使用它。

于 2017-03-07T08:21:32.613 回答
1

解决 了感谢伯恩德!解决了这个问题。这里有一个完整的例子:

mystyles.content.get = CONTENT 
mystyles.content.get {
    table = tt_content
    select {
        orderBy = sorting
        where = colPos=0
    }
}


page.10 = FLUIDTEMPLATE
page.10 {
    partialRootPath ={$resDir}/Private/Partials
    layoutRootPath = {$resDir}/Private/Layouts

    variables {
        contentMain < mystyles.content.get
        contentMain.select.where = colPos = 0
        contentnew < mystyles.content.get
        contentnew.select.where = colPos = 1
        contentkat < mystyles.content.get
        contentkat.select.where = colPos = 2

        test = TEXT
        test.value = loool
    }
}
于 2017-02-24T13:22:53.310 回答