Home    Articles

 

How to add static block to left side on magento homepage

 

To add a new static block with some information text, some images or few products on homepage or other pages may be frustrating, becouse you can’t just add the html code.
You have to make sure that any changes will not affect in the future the upgrade of magento.

1) First step is to create a new static block in admin.
Go to admin area ->CMS->Static Blocks and click Add New Block

Fillup the fields:
Block Title (how you want to see it in admin area)
Identifier (how will be named the block to be identified in layouts)
Select All Store Views
Status (enabled)
Content (the html code, you can make css here too….for a test add a string “Test”)

Save the block.
The page will look something like this.
add_statick_block

2) Now we need to add this block in layouts.

Let’s add this block on homepage first.
Go to CMS->Pages->Home Page.
Click on Design, make sure that the Layout field is 2 columns with left bar
In Layout Update XML you have to add (if not exist).

<reference name="left">
</reference>

If does exist, somewhere between these reference tags, set your block:

<reference name="left">
       <!-- Probably some other content -->
       <block type="cms/block" name="here type your block identifier" >
          <action method="setBlockId"><block_id>here type your block identifier</block_id></action>
       </block>    
</reference>

Clear your cache and refresh your homepage.

if this block need to stay on category page or product view page you have to go to app/…./your theme/layout/catalog.xml and find the tag and set your block there.

That’s all. Enjoy.

by