2

我正在尝试在Shopware 5.2的自定义主题中包含来自自定义插件的模板。

主题模板包含以下行:

{include file="frontend/custom/colorpicker.tpl"}

插件模板位于/custom/plugins/PLUGINNAME/Resources/views/frontend/custom/colorpicker.tpl

我收到以下错误消息:

致命错误:未捕获的 SmartyException:无法在 'frontend/detail/index.tpl|frontend/plugins/seo/index.tpl' 中加载模板片段 'frontend/custom/colorpicker.tpl' in...

我已经尝试将父级添加到文件路径中,但没有任何乐趣。错误消息消失,但未加载模板:

{include file="parent:frontend/custom/colorpicker.tpl"}

不幸的是,我在 Shopware 文档中找不到任何内容,说明是否有任何特殊需要从插件中包含模板。

4

1 回答 1

4

protected $injectBeforePlugins = true;尝试在主题中添加类变量Theme.php

https://developers.shopware.com/designers-guide/smarty/#inheritance-and-plugin-templates

于 2016-12-15T12:14:23.780 回答