![](/img/trans.png)
[英]TYPO3 CMS EXT:webkitpdf error CacheDatabaseBackend TYPO3 9.5
[英]TYPO3 eventnews ext - default template change error
我在更改eventnews
月视图的模板时eventnews
问题。 我已经将模板EXT:eventnews / Resources / Private / Templates / Month.html复制到了保存List.html或Detail.html之类的文件的同一目录中。 但是在网站上我有这样的错误:
抱歉,找不到所需的视图。
技术原因是:找不到模板。 无法为类“ GeorgRinger \\ News \\ Controller \\ NewsController”中的操作“ month”解析视图。
但是当我用默认模板粘贴TypoScript时:
plugin.tx_news {
view {
templateRootPaths {
0 = {$plugin.tx_news.view.templateRootPath}
1 = EXT:eventnews/Resources/Private/Templates/
}
}
}
一切正常...
问题出在哪儿?
这是我的配置:
更新
在更改事件的设置中添加下面的打字稿。
plugin.tx_news {
view {
templateRootPaths.1 = fileadmin/eventnews/Templates/
}
}
然后粘贴在此路径( fileadmin/eventnews/Templates/
)模板文件上。
如果要覆盖Template EXT:eventnews/Resources/Private/Templates/Month.html
,则必须将文件复制到单独的位置(例如复制到自己的扩展名中),并向templateRootPaths 添加一个附加路径,其路径号应大于现有路径:
plugin.tx_news {
view {
templateRootPaths {
20 = EXT:mycustomext/Resources/Private/Templates/
}
}
}
这样,typo3将先检查该位置,然后再测试其他位置。
如果不覆盖所有模板,则覆盖0
和1
可能会导致问题。
正如Riccardo De Contardi所建议的那样,我已经在“ ext”目录中复制了确切的扩展结构,然后覆盖了TS模板。
plugin.tx_news {
view {
templateRootPaths {
0 = {$plugin.tx_news.view.templateRootPath}
1 = fileadmin/ext/eventnews/Resources/Private/Templates/
}
}
}
现在一切正常。
如果设置了常量:
plugin.tx_news.view.templateRootPath = fileadmin/new-site/ext/news/Templates/
我希望您将文件放入:
fileadmin/new-site/ext/news/Templates/News/Month.html
一切都应该开箱即用。 这样行吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.