0

I am trying to add a CMS static block, to the magento 1 contacts page, in the right column.

I've tried adding the following to

app/design/frontend/{client}/{theme}/layout/local.xml

<contacts_index_index>
    <reference name="right">
        <block type="cms/block" name="contact_stores">
            <action method="setBlockId"><block_id>contact_stores</block_id></action>
        </block>
    </reference>
</contacts_index_index>

I've also tried overriding the contacts.xml file and adding:

<reference name="right">
    <block type="cms/block" name="contact_stores">
        <action method="setBlockId"><block_id>contact_stores</block_id></action>
     </block>
</reference>

But neither of this show up on the page... What have I missed?

Edit: I have now also tried adding a block with a template as follows:

<reference name="right">
    <block type="page/html" name="product.stores" before="banner.right" as="contact_stores" template="moores/contact_right_block.phtml"/>
</reference>

and the template has the following:

<div class="banner_right">
<?php 
    echo $this->getLayout()->createBlock('cms/block')->setBlockId('contact_stores')->toHtml();
?>
</div>

This also fails to add anything to the page?

  • have you checked the template file to see it is calling for <?php echo $this->getChildHtml(); ?> – Dava Gordon Mar 20 at 10:30
  • The page uses the 2columns-right template. In 2columns-right.phtml, I can see <?php echo $this->getChildHtml('right') ?> – claydon_dan Mar 20 at 10:33
  • Id suggest rechecking which template it is using try changing it to reference name left see if they have used that template and floated the column to the right – Dava Gordon Mar 20 at 10:40
  • here you are missing like contact_stores where it is id to be mention ok – MehulKanjariya Mar 20 at 11:20
  • @DavaGordon can confirm it is definitely using the 2column-right template. As this is shown when I turn on template path hints – claydon_dan Mar 20 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.