我在让自定义参考块在 Magento 中工作时遇到了一些麻烦。
这些是我采取的步骤:
第1步
在 page.xml 中创建了一个新的“参考”块
<block type="core/text_list" name="newreference" as="newreference"></block>
第2步
在我希望它出现在页面中的位置添加了对此块的引用(在 1column.phtml、2columns-left.phtml、2columns-right.phtml、3columns.phtml 中的页脚上方)
<?php $this->getChildHtml('newreference'); ?>
第 3 步
添加了对 catalog.xml 的引用,它告诉 Magento 我想在类别页面的“newreference”引用块中输出模板部分(specialfooter.phtml)
<reference name="newreference">
<block type="core/template" name="specialfooter" template="page/html/specialfooter.phtml"></block>
</reference>
第4步
在 page/html/ 目录中创建了“specialfooter.phtml”,并带有一个简单的段落块进行测试。
什么也没有发生。
我采取的步骤符合我对参考块如何工作的理解,但我可能是错的。我正在努力寻找任何文件,官方或其他文件,或任何以前的 SO 问题,这些问题对这个主题有任何启发。
我正在使用 Magento 版本。1.7.0.2。
任何帮助将非常感激。