数据库内容未显示Typo3 7.6 Fluid模板

时间:2019-06-13 12:49:40

标签: typoscript fluid typo3-7.6.x

我在“ fileadmin”文件夹中有一个可以正常工作的模板。但是我尝试将数据加载到该html文件中。

我在打字稿中的Page部分看起来像这样:

page = PAGE
page.20 = FLUIDTEMPLATE
page.20 {
   templateName = index1
   templateRootPaths.20 = fileadmin/templates/temp/
   table = tt_content
   select {
      selectFields = tt_content.*
      where = colPos = 0
      orderBy = tt_content.sorting
   }
}

如果我删除templateNametemplateRootPaths,会收到错误消息。

1 个答案:

答案 0 :(得分:0)

我认为您在复制该代码时错过了几行。
select中没有FLUIDTEMPLATE属性。

如果要向Fluid提供一些数据,则需要使用属性variables

page = PAGE
page.20 = FLUIDTEMPLATE
page.20 {
    templateName = index1
    templateRootPaths.20 = fileadmin/templates/temp/

    variables {
        columnData = CONTENT
        columnData {
            table = tt_content
            select {
                selectFields = tt_content.*
                where = colPos = 0
                orderBy = tt_content.sorting
            }
        }
        // it's the same:
        columnData2 < styles.content.get
    }
}

在液体中,您可以使用:

{columnData->f:format.raw()}