0

在 TYPO3 8.7 中,我试图覆盖Textpic.html来自 fluid_styled_content 的文件,以便我可以对 textpic 内容元素使用自己的渲染。

只要我修改扩展本身内的原始文件,就可以正常工作。

但是,我想创建自己的该文件副本并使用该副本。这不起作用 - TYPO3 不使用我自己的文件版本。

这是我所做的:

在我的 TypoScript 模板的设置字段中,我添加了:

lib.contentElement.templateRootPaths.100 = /fileadmin/template/Templates/

然后我Textpic.html从复制fluid_styled_content/Resources/Private/Templates到我的文件夹/fileadmin/template/Templates中,使其变为/fileadmin/template/Templates/Textpic.html.

任何提示,我可能会错过什么?

4

2 回答 2

1

您可以通过设置常量来做到这一点。例如

styles.templates {
    templateRootPath = EXT:siteconfig/Resources/Private/Extensions/fluid_styled_content/Templates/

    partialRootPath = EXT:siteconfig/Resources/Private/Extensions/fluid_styled_content/Partials/

    layoutRootPath = EXT:siteconfig/Resources/Private/Extensions/fluid_styled_content/Layouts/
}

因此将首先检查这些位置,如果某个内容元素没有文件,则将使用fluid_styled_content 的版本。

在 /typo3/sysext/fluid_styled_content/Configuration/TypoScript/constants.txt 检查原件

确保为部分保留相同的子文件夹结构。

于 2018-08-17T11:47:14.513 回答
0

问题是线路

lib.contentElement.templateRootPaths.100 = /fileadmin/template/Templates/

这条线是错误的。路径的开头不能有斜线。

右边一行写着:

lib.contentElement.templateRootPaths.100 = fileadmin/template/Templates/

我在https://docs.typo3.org/typo3cms/TemplatingTutorial/BasicFluidTemplates/Index.html的模板教程的代码示例中发现了这一点。

于 2018-08-17T14:59:16.200 回答