【问题标题】:Overriding fluid_styled_content isn't working as expected覆盖 fluid_styled_content 没有按预期工作
【发布时间】:2018-07-17 08:50:44
【问题描述】:

大家好,

我一直在努力从fluid_styled_content 中覆盖一些默认内容元素的模板、部分和标题。 例如,让我们说“标题”。

我还有一个数据处理类,用于从 tt_content 表中获取某些字段以在标头内进行处理。 无论如何,我可以在模板中接收到这个获取的数据。但不是在局部或布局中。 有没有人遇到过同样的情况?

这是我的 TS 设置:

lib.contentElement {
  templateRootPaths {
     200 = EXT:my_ext/Resources/Private/Templates/
  }
  partialRootPaths {
     200 = EXT:my_ext/Resources/Private/Partials/
  }
  layoutRootPaths {
     200 = EXT:my_ext/Resources/Private/Layouts/
  }
}

//custom content element definition

tt_content {
  header < lib.contentElement
  header {
     templateName = Header
     dataProcessing {
        1 = VENDOR\MyExt\DataProcessing\ContentProcessor
     }
  }
}

【问题讨论】:

  • 请提供有关您的 TYPO3 版本的提示,因为不同版本的处理方式不同。

标签: typo3 fluid fluid-styled-content


【解决方案1】:

我认为这与您的打字顺序有关。

在您的示例中,您有代码

tt_content {
    header < lib.contentElement
    :

复制lib.contentElement 对象。它在检测到copy operator 时复制处于该状态的对象。将不包括以下任何更改。

如果你想构建一个reference,你可以在之后更改引用('复制')对象,所有这些更改也应该是活动的,你需要使用reference operator

tt_content {
    header =< lib.contentElement
    :

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-07
    • 2021-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-20
    • 1970-01-01
    相关资源
    最近更新 更多