Add a footer, Header or Content static callout block for Magento CMS page
This article first published in Lotus From The Mud.
Magento offers lots of flexibility for Magento theme design, but it takes a bit of digging and exploring before one can learn to do a new simple trick.
In the Magento default template, it shows us how to place a permanent callout block in the left column by using the
<reference name="left">...</reference>
Example of the code is located in the catalog.xml, right in the <default> section.
<reference name="left">
<block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">
<action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action>
<action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (800) DEMO-NUMBER.</alt></action>
<action method="setLinkUrl"><url>checkout/cart</url></action>
</block>
</reference>
This is one way of doing it. Though it’s nice, easy and straight-forward, but it lacks the flexibility and the method maybe a bit intimidating to people who know very little about web design and get nervous on touching the source code. So, to make it a bit more friendly for store owner, we can replace the above code to a static block with a block ID, so that store owner can add a new static block in the admin/CMS/Static Block, and can place as many images and content as he sees fit.
How do we do that?
To achieve this, we use the following code instead, and name the block ID as left_column_block. Note that because I wanted this callout block shows up in every page, so I have it placed in the
<reference name="left">
<block type="cms/bock" name="left.permanent.callout ">
<action method="setBlockId"><block_id>left_column_block</block_id></action>
</block>
</reference>
Then I go to admin/CMS/Static Block, add a new block, enter a block title, enter left_column_block as Identifier; enable it, and enter something in the content area. In this example I am using a promotional teaser image file:
<a href="http:/your-domain.com/destination-of-this-image"><img src="" width="206" class="callout" alt="25% off " /> </a>
Here comes the result after saving the block:

How about taking it to the next level?
With the same method, we can extend the static block to header, footer and the content area. In the following example, I am going to show you how to do it for the footer block.
To do this, we follow the same step as the left_column_block and reference it to footer; because it’s most logical to have this footer static block shows up throughout the entire site, so I am going to place it in the <default> section in the catalog.xml and I named it footer_callout_block.
<reference name="footer">
<block type="cms/block" name="footer.permanent.callout" as="footer_callout">
<action method="setBlockId"><block_id>footer_callout_block</block_id></action>
</block>
</reference>
One more step before creating a new static block in the admin CMS.
In order for the footer callout block shows up, we need to add a “getChildHtml” to invoke the block in the CMS static block. So we go open up the footer.phtml which is located in the page/html. Note that to have the block shows up exactly where you want it be, requires a bit of CSS coding, but I will skip this part as this is a design decision that you should make, not me. In my example, I have a 2 columns floated layout in the footer, and I want this footer_callout_block placed on the right column, so I have it placed inside the col2 like so:
<div class="col2">
<?php echo $this->getChildHtml('footer_callout') ?>
</div>
Then I proceed to the last step by creating a new static block in the admin CMS, and name the following:
- Block Title*: Footer Callout Block
- Identifier*: footer_callout_block
- Content *: <a href=""> <img src="" width="377" alt="ship via USPS and UPS" /> </a>

Get Creative and take it even further
With the same method and logic, we can extend it to have different static blocks (content/images) place in different area of the site or have them place on specific page. For example, if I want to show an image in the cart page or customer logged in area, I can have it calls in the customer.xml or cart.xml.

We are
Thanks for your article, I’m trying out some of your suggestions in order to create a static callout block but it seems it’s not working for me, I just added this code: (in catalog XML)
top_center_block
....
Also create the Staticblock in Admin/CMS and I can not see my new static content… any feedback, idea, suggestion, please?.
Thanks in advance.
I just fixed it, in your example you posted: type=”cms/bock” instead of type=”cms/block”… it seems you forget to write an “l” ;)
Thank you anyway for your comments.
:) Thank you very much!!!!! Been pulling my hair out all over the weekend and in work today, this is just what I’m after, nice and easy to understand, works great!
Keep up the good work and thanks again, I’ll bookmark your site and look forward to more magento tips & tricks.
Barry :)
very helpful , thanks for this article. :D