在 Magento CMS 中更改模板搜索位置
Changing template search location in Magento CMS
我想让我的 CMS 页面之一访问 frontend/default/[theme]/[plugin] 目录中的模板。
我当前访问此模板的代码是这样的:
{{block type="core/template" template="path/to/template.phtml"}}
这会检查 frontend/base/default/template/... 是否有检查默认文件夹中模板的变量类型?
我想每次添加新块时都必须指定 name
属性。
只需将其添加到您的代码中即可。
{{block type="core/template" template="path/to/template.phtml" name="mycustomblock"}}
这将从您当前的主题中添加模板。
提醒:如果这是自定义块(不是core/template),您可能需要whitelist it。
这应该有效。 ;)
我想让我的 CMS 页面之一访问 frontend/default/[theme]/[plugin] 目录中的模板。
我当前访问此模板的代码是这样的:
{{block type="core/template" template="path/to/template.phtml"}}
这会检查 frontend/base/default/template/... 是否有检查默认文件夹中模板的变量类型?
我想每次添加新块时都必须指定 name
属性。
只需将其添加到您的代码中即可。
{{block type="core/template" template="path/to/template.phtml" name="mycustomblock"}}
这将从您当前的主题中添加模板。
提醒:如果这是自定义块(不是core/template),您可能需要whitelist it。
这应该有效。 ;)