Magento – Adding a new reference block to Magento

magentomagento-1.7

I'm having some trouble getting a custom Reference block to work in Magento.

These are the steps I have taken:

Step 1

Created a new “Reference” block in page.xml

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

Step 2

Added a reference to this block in the place I want it to appear in the page (above the footer in 1column.phtml, 2columns-left.phtml, 2columns-right.phtml, 3columns.phtml)

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

Step 3

Added a reference to catalog.xml which tells Magento I want to output a template part (specialfooter.phtml) in the ‘newreference’ Reference block on Category pages

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

Step 4

Created ‘specialfooter.phtml’ in the page/html/ directory with a simple paragraph block to test.

And nothing happens.

The steps I have taken fit with my understanding of how Reference blocks work, but I could be wrong. I'm struggling to find any documentation, official or otherwise, or any previous SO questions which sheds any light on the subject.

I'm using Magento ver. 1.7.0.2.

Any help would be much appreciated.

Best Answer

Don't you have forget a echo ? :

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