【问题标题】:Changing template search location in Magento CMS在 Magento CMS 中更改模板搜索位置
【发布时间】:2019-07-06 20:28:43
【问题描述】:

我想让我的 CMS 页面之一访问位于 frontend/default/[theme]/[plugin] 目录中的模板。

我当前访问此模板的代码是这样的:

{{block type="core/template" template="path/to/template.phtml"}}

这会检查 frontend/base/default/template/... 是否有变量类型可以检查默认文件夹中的模板?

【问题讨论】:

    标签: magento content-management-system


    【解决方案1】:

    我猜每次添加新块时都必须指定name 属性。

    只需将其添加到您的代码中即可。

    {{block type="core/template" template="path/to/template.phtml" name="mycustomblock"}}
    

    这将从您当前的主题添加模板。

    提醒:如果这是自定义块(不是核心/模板),您可能需要whitelist it

    这应该可以。 ;)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-19
      • 2017-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多