web hosting
build a website

Positioning a Static block in the Left bar in Magento

Mar 31, 2013   //   by Anthony Devine   //   Website Development tips  //  Comments Off on Positioning a Static block in the Left bar in Magento

If you do not have access to the Core PHP files in Magento you may struggle to change the layout of the left hand navigation. However you can add addition static blocks to the left hand or right hand sides by doing the following: Create a static block and add in the content you want displaying in the sidebar. Then in Catalog > Manage Categories select the subcategory you wish to assign the static block to and then click the Custom Design tab. In the Custom Design tab you should have the Page Layout set to how you want the page laying out so 2 columns with Left bar or right bar or 3 columns, then in the Custom Layout Update box add in the following code:

<reference name="left">
     <block type="cms/block" before="block-compare" name="menspagedescription">
        <action method="setBlockId"><block_id>menspagedescription</block_id></action>
     </block>
</reference>
This basically gets the ID of the static block you created menspagedescription and assigns it to the left hand column. It also adds it above the item in the left hand column called block-compare this block will obviously be different on your site as this is a plugin I have installed on the left hand side. You can find out what the block are called for your left hand side either by looking at the IDs in the backend of Magento or by using Firebug and it will show you the block class when hovered over the item.

This is the most simple method I have come across for positioning static content in the sidebars.