从tt_content中读取带有typoscript的扩展字段

时间:2016-07-21 12:46:48

标签: typoscript typo3-7.6.x bootstrap-carousel

我在TYPO3 7.6实例中安装了Bootstrap Carousel Extension。 这为tt_content添加了一个名为“konigbootstrapcarousel_slides”的字段

现在在我的typoscript中我想检查/读取该字段是否有值。 我想将此值传递给我的Header.html部分。 然后在部分渲染中,如果设置了Bootstrap Carousel的值,则使用不同的html。

到目前为止,我尝试了很多东西......这是一个例子。

lib.isPlugin = TEXT
lib.isPlugin {
    key.data = konigbootstrapcarousel_slides
}

然后在变量中:

variables {
    isplugin < .lib.isPlugin
}

更新
得到了它:

lib.isPlugin = CONTENT
lib.isPlugin {
  table = tt_content
  select {
    where = (koningbootstrapcarousel_slides > 0)
  } 
}

我无法相信没有办法从{_all}数组

中获取这类信息

1 个答案:

答案 0 :(得分:1)

您无法使用TS读取tt_content字段。 Typoscript配置仅适用于“页面”表。

对于您的解决方案:您向页面添加后端布局,并使用<f:if condition="{data.backend_layout} == 1">

在Header.html中检查此布局
相关问题