我正在使用 TYPO3 7.6.13,并且正在尝试自定义新闻扩展。我正在尝试插入我自己的自定义模板,但 TYPO3 找不到它,因此始终包含默认模板。
我在 Configuration/TypoScript 目录中自定义了 setup.txt 和 constants.txt 文件。
我还在 fileadmin 目录中为模板和部分创建了自定义目录:fileadmin/templates/ext/news/templates/fileadmin/templates/ext/news/partials/
这是 setup.txt 的一部分:
plugin.tx_news {
mvc.callDefaultActionIfActionCantBeResolved = 1
view {
templateRootPaths {
0 = EXT:news/Resources/Private/Templates/
1 = {$plugin.tx_news.view.templateRootPath}
}
partialRootPaths {
0 = EXT:news/Resources/Private/Partials
1 = {$plugin.tx_news.view.partialRootPath}
}
layoutRootPaths {
0 = EXT:news/Resources/Private/Layouts/
1 = {$plugin.tx_news.view.layoutRootPath}
}
widget.GeorgRinger\News\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = EXT:news/Resources/Private/Templates/
}
我已将我在 fileadmin 中创建的模板和部分添加到 constants.txt 自定义目录中。下面是 constants.txt 代码:
plugin.tx_news {
rss.channel {
title = Dummy Title
description =
link = http://example.com
language = en-gb
copyright = TYPO3 News
category =
generator = TYPO3 EXT:news
}
opengraph {
site_name =
twitter {
card = summary
site =
creator =
}
}
view {
# cat=plugin.tx_news/file; type=string; label=Path to template root (FE)
templateRootPath = fileadmin/templates/ext/news/templates/
#templateRootPath.1 = EXT:news/Resources/Private/Templates/
# cat=plugin.tx_news/file; type=string; label=Path to template partials (FE)
partialRootPath = fileadmin/templates/ext/news/partials/
#partialRootPath.2 = EXT:news/Resources/Private/Partials/
# cat=plugin.tx_news/file; type=string; label=Path to template layouts (FE)
layoutRootPath = EXT:news/Resources/Private/Layouts/
}
settings {
# cat=plugin.tx_news/file; type=string; label=Path to CSS file
cssFile = EXT:news/Resources/Public/Css/news-basic.css
}
}
任何帮助是极大的赞赏!丹尼斯