【问题标题】:TYPO3 fluid variablesTYPO3 流体变量
【发布时间】:2017-07-14 14:16:42
【问题描述】:

我将 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>

【问题讨论】:

    标签: typo3 fluid-styled-content


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

      • 如果有人帮助您回答问题,请他将评论放入答案并接受和/或投票,建议删除您自己的答案,您的决定
      • 在我的解决方案中,我建议使用temp.content.get,因为所有以temp. 开头的TS 对象在渲染执行之前都会被删除,从而导致更小的配置数组。特别是对于被复制的原型,在渲染时不需要知道。
      【解决方案3】:

      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,因此它可以识别为我自己的版本(如果 global 定义发生变化,则不会混淆)

      【讨论】:

        猜你喜欢
        • 2021-09-01
        • 1970-01-01
        • 2017-02-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-10-09
        • 2015-04-05
        相关资源
        最近更新 更多