gpt4 book ai didi

TYPO3 tx_news 扩展不使用覆盖模板

转载 作者:行者123 更新时间:2023-12-02 06:30:53 25 4
gpt4 key购买 nike

我有两个站点使用 tx_news 扩展。据我所知,它们的设置相同。在站点 A 上,我添加了一个新的 List.html 部分,它按预期工作。然而,在站点 B 上,它完全忽略了我的列表覆盖。

我已经对文件路径进行了三次检查,以确保拼写错误指向正确的位置,但它仍然使用默认值。这里可能出了什么问题?

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/
}
}
}

最佳答案

为了使其按预期工作,我将执行以下操作:

1) 复制ext/news/Resources/Private/Templates, Partials, Layouts 三个文件夹到fileadmin/templates/example/news(我相信你已经做到了)

2) 然后将其放入您的模板提供程序或页面 typoscript constants:

plugin.tx_news {
view {
templateRootPath = fileadmin/templates/example/news/Templates/
partialRootPath = fileadmin/templates/example/news/Partials/
layoutRootPath = fileadmin/templates/example/news/Layouts/
}
}

现在新闻扩展将使用放在 fileadmin/中的模板文件

下一步是在您的根页面属性中添加一些 pageTSConfig,以防您需要更大的灵 active 。例如像这样:

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>

关于TYPO3 tx_news 扩展不使用覆盖模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37857681/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com