【问题标题】:Tell TYPO3 extension to use different template using Typoscript使用 Typoscript 告诉 TYPO3 扩展使用不同的模板
【发布时间】:2012-11-20 16:15:39
【问题描述】:

我正在尝试在页面上获取扩展程序/插件,以使用与其硬编码的模板不同的模板。

我制作了一个 html 模板存储在: 错字3conf/ext/myextension/pi1/new_extension_template.html

我在我网站的根目录中创建了一个打字稿模板对象(所以它肯定会被选中)。 在其中,我定义了以下简单的 Typoscript(为了演示而更改了名称)

plugin.tx_myextension_pi1 {
     templateFile = typo3conf/ext/myextension/pi1/new_extension_template.html
}

但是,当我加载包含该插件的页面时,我在那个黑色的 TYPO3 错误页面上收到“找不到打字稿模板”错误。

我尝试了很多替代方法以防语法错误,但在使用 tt_news 插件时,上述方法对我有用。

例如,我也尝试过这些但没有成功:

templateFile.file = typo3conf/ext/myextension/pi1/new_extension_template.html
...
tempfile.template_file = typo3conf/ext/myextension/pi1/new_extension_template.html

任何想法我做错了什么? 存储在typo3conf中的html模板可以通过插件外存储的typoscript调用吗?

我想也许 html 模板文件必须存储在 fileadmin/plugin_templates/ 中才能正常工作。

【问题讨论】:

    标签: templates plugins typo3


    【解决方案1】:

    您在混用:no typoscript template found 表示在您插入插件的页面上没有可用的 TS 模板。

    带有插件的页面没有嵌套在主页下(我假设它有 main TS template 并正确显示),所以只需将其拖到主页中,或在其级别上创建新的 TS 模板。

    【讨论】:

      猜你喜欢
      • 2016-10-17
      • 1970-01-01
      • 2023-04-08
      • 1970-01-01
      • 2014-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-24
      相关资源
      最近更新 更多