Magento tips & tricks: How to add a static block to the homepage

If you are trying to add a static block to the homepage, try following these steps:

1) Create your static block in the admin system:

cms > static block > add new block

Give your static block a Block Title, an Identifier and select the store view that you wish it to appear on.

Enable your static block and add some content.

This is an example of a static block:

Block title: testblock
Identifier: testblock
Store view: All store views
Status: Enabled
Content This is a test block

2) Save your block and go to CMS > Pages > Homepage

3a) If you want your block in the left column add the following code to Design > Layout Update XML

1
<reference name="left"> <block type="cms/block" name="testblock" after="-"> <action method="setBlockId"><block_id>testblock</block_id></action> </block> </reference>

3b) If you want your block in the center section, add the following code to Design > Layout Update XML

1
<reference name="content"> <block type="cms/block" name="testblock" after="-"> <action method="setBlockId"><block_id>testblock</block_id></action> </block> </reference>

3c) If you want your block in the right column, add the following code to Design > Layout Update XML

1
<reference name="right"> <block type="cms/block" name="testblock" after="-"> <action method="setBlockId"><block_id>testblock</block_id></action> </block> </reference>

4) Save your page and refresh your cache. Fingers crossed you should have a static block where you want it to be. :)

Note: If you do not want you block to appear after everything in that column change the after=”-” section of the code. e.g. after=”cart_sidebar” would display the new block below the cart before=”cart_sidebar” would display the new block above the cart

This entry was posted in Magento. Bookmark the permalink.