如何将新模板添加到Typo3“布局”下拉列表中

时间:2012-03-16 12:09:02

标签: templates typo3 typoscript

我有一个Typo3安装,有3个现有的布局选项。这些都在page.ts文件中声明,如下所示:

#normal layout:
[globalVar=TSFE:page|layout=0]
    page.10.template.file = fileadmin/template/classic-page.html
    page.includeCSS.screen = fileadmin/template/css/style.css
    page.includeCSS.screen.media = screen
[global]

并且它们都在page.ts文件中的这个列表中,如下所示:

TCEFORM.pages {
layout.altLabels.0 = Normal 
layout.altLabels.1 = Startpage
layout.altLabels.2 = Landing page
}

所有这些布局选项都显示在“编辑页面(X)”>中的CMS中。外观页面,在可能的布局选项的下拉列表中。方便!

现在我想要添加一个闪亮的新模板作为选项。我可以通过将此代码添加到page.ts来将其应用于特定页面ID(例如,页面编号#563):

[globalVar = TSFE:id=563]
page.10.template.file = fileadmin/template/shinynewtemplate.html
[GLOBAL]

但我似乎无法将其添加为下拉菜单中的新布局选项。我试过这个:

#shiny new layout:
[globalVar=TSFE:page|layout=3]
    page.10.template.file = fileadmin/template/shinynewtemplate.html
    page.includeCSS.screen = fileadmin/template/css/style.css
    page.includeCSS.screen.media = screen
[global]

TCEFORM.pages {
layout.altLabels.0 = Normal 
layout.altLabels.1 = Startpage
layout.altLabels.2 = Landing page
layout.altLabels.3 = Shiny new page
}

但没有香蕉。它没有显示在外观布局列表中,因此我无法将其应用于页面。

我错过了什么?我是否需要在其他地方声明此模板文件,以便它在下拉列表中显示为选项?

1 个答案:

答案 0 :(得分:7)

如果没有可以使用您标签的商品,则替代标签无效。

您需要添加新项目(Page TS Config!):

TCEFORM.pages {
  layout.addItems.3 = Shiny new page
}

请参阅TSconfig

相关问题