magento - 向 Magento 添加新的引用 block

标签 magento magento-1.7

我在让自定义引用 block 在 Magento 中工作时遇到一些问题。

这些是我已采取的步骤:

第 1 步

在 page.xml 中创建了一个新的“引用” block

<block type="core/text_list" name="newreference" as="newreference"></block>

第 2 步

在我希望它出现在页面中的位置添加了对此 block 的引用(1column.phtml、2columns-left.phtml、2columns-right.phtml、3columns.phtml 中的页脚上方)

<?php $this->getChildHtml('newreference'); ?>

第3步

添加了对catalog.xml的引用,它告诉Magento我想在类别页面的“newreference”引用 block 中输出模板部分(specialfooter.phtml)

<reference name="newreference">
     <block type="core/template" name="specialfooter" template="page/html/specialfooter.phtml"></block>
</reference>

第 4 步

在 page/html/目录中创建“specialfooter.phtml”,并使用一个简单的段落 block 进行测试。

什么也没发生。

我所采取的步骤符合我对引用 block 如何工作的理解,但我可能是错的。我正在努力寻找任何官方或其他文件,或任何以前的 SO 问题来阐明该主题。

我正在使用 Magento 版本。 1.7.0.2。

任何帮助将不胜感激。

最佳答案

你没有忘记echo吗? :

<?php echo $this->getChildHtml('newreference'); ?>

关于magento - 向 Magento 添加新的引用 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13043859/

相关文章:

mysql - 最小化数据库以便从 Magento 导出所有产品

玛根托 : Out of stock products showing last in the category page

magento - 如何在 magento 1.7 中创建自定义信用卡支付模块

magento-1.7 - 一页结帐过程在 magento 1.7.0.1 中显示两种运输方式

magento 更新付款后总支付

wordpress - Fishpig Magento 模块 : How to get data from postmeta table?

Magento:通过 'Custom Layout Update' 进行产品特定设计

magento - Magento索引问题-无法重新索引

Magento,网格,添加带有网站链接的列

magento - 有没有办法在 Magento 中更改登录页面 URL?