2017-02-23 97 views
1

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

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> 

回答

2

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

目前最好的解决办法似乎是styles.content.get早在TS一个自己的定义:

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

,但因为它是一个自己定义我会把它重新命名为temp.content.get所以它是标识为我自己的版本(无混乱,如果全球定义更改)

0

解决 感谢贝恩德!解决了这个问题。 下面一个完整的例子:

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 
    } 
} 
+0

如果有人帮助你解答,请他将评论置于答案中,并接受和/或赞成,建议删除你自己的答案,在我的解决方案中你的决定 – Gang

+1

我建议使用'temp.content。 get',因为所有以'temp.'开始的TS对象在执行渲染之前被移除,导致更小的配置数组。特别是对于复制的原型,在渲染时不需要知道。 –

1

有一个在TYPO3 8.6的一个Bug:https://forge.typo3.org/issues/80044

添加此分配styles.content.getvariables前: <INCLUDE_TYPOSCRIPT: source="FILE:EXT:frontend/ext_typoscript_setup.txt"> 然后你就可以像以前一样使用它。