我有两个使用tx_news扩展名的网站。据我所知,他们的设置完全相同。在网站A我添加了一个新的List.html部分,它按预期工作。但在网站B上,它完全忽略了我的列表覆盖。
我已经对文件路径进行了三次检查,以确保typoscript指向正确的位置,但它仍然使用默认值。这可能有什么问题?
plugin.tx_news {
view {
templateRootPaths >
templateRootPaths {
0 = EXT:news/Resources/Private/Templates/
1 = fileadmin/templates/example/news/Templates/
}
partialRootPaths >
partialRootPaths {
0 = EXT:news/Resources/Private/Partials/
1 = fileadmin/templates/example/news/Partials/
}
layoutRootPaths >
layoutRootPaths {
0 = EXT:news/Resources/Private/Layouts/
1 = fileadmin/templates/example/news/Layouts/
}
}
}
答案 0 :(得分:4)
为了使其按预期工作,我会执行以下操作:
1)将三个文件夹从ext / news / Resources / Private / Templates,Partials,Layouts复制到fileadmin / templates / example / news (我相信你已经这样做了)
2)然后将其放入模板提供者或页面 typoscript常量:
plugin.tx_news {
view {
templateRootPath = fileadmin/templates/example/news/Templates/
partialRootPath = fileadmin/templates/example/news/Partials/
layoutRootPath = fileadmin/templates/example/news/Layouts/
}
}
现在,新闻扩展将使用fileadmin /
中的模板文件下一步是在您的根页面属性中添加一些pageTSConfig,以防您需要更多灵活性。例如:
tx_news.templateLayouts {
1 = Special List Item
2 = Special Detail Layout
}
这样您就可以在新闻插件中选择其中一个模板布局,并在模板文件中使用条件:
<f:if condition="{settings.templateLayout} == 1">
<f:then>
<!-- markup for a special list item -->
</f:then>
<f:else>
<!-- markup for another list item -->
</f:else>
</f:if>
答案 1 :(得分:2)