【问题标题】:magento: How to add a phtml block from the template to a CMS pagemagento:如何将模板中的 phtml 块添加到 CMS 页面
【发布时间】:2012-10-15 08:09:47
【问题描述】:

我在一个名为“shopper”的模板中有一个块。我想添加一个块 “app\design\frontend\default\shopper\template\tag\popular.phtml”。

我试过了:

    {{block type='core/template' area='frontend' template='tag/popular.phtml' }}

该块未显示。也没有 PHP 错误。

【问题讨论】:

  • 您应该始终将id 属性与typetemplate 一起分配。

标签: magento


【解决方案1】:

你试过了吗

{{block type="core/template" template="tag/popular.phtml"}}

如果这不起作用,请确保清除缓存(如果有)并仔细检查“购物者”是否设置为您的默认主题。

阅读更多@http://www.magentocommerce.com/boards/viewthread/221573/

如果 'tag/popular.phtml' 的内容与 base/template/tag/popular.phtml 相同或相似,则尝试

{{block type="tag/popular" template="tag/popular.phtml"}}

【讨论】:

  • “系统>>配置>>设计>>主题>>默认”现在是“购物者”。还是没有影响。我在想这可能是主题阻碍了一切?
  • popular.phtml的内容和/app/design/frontend/base/default/template/tag/popular.phtml一样吗?
  • 缓存已禁用。默认路径没有标签文件夹,我将标签文件夹复制到那里并且没有影响。我现在确定主题 shopper 正在阻止这些块。因为除了local.xml 之外没有任何布局,我处理的任何 xml 都没有影响。
  • 您是否安装了任何自定义模块...如果有,请尝试禁用它们并重试。
猜你喜欢
  • 1970-01-01
  • 2023-03-09
  • 1970-01-01
  • 2012-04-22
  • 2012-05-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-15
相关资源
最近更新 更多