Adding CMS Block in the left or – right column of a CMS page – Magento

In this example we will add a “payments” block / image to the left column of the magento page. For e.g. a Paypal GIF showing customers the payment methods available.
When adding content to the left or right column of the Magento template you need to firstly create a static block:
1
Admin -> CMS -> Static Blocks
Fill out the required content – keep note of the single worded indentifier
E.g.
1
payment_box
Enable to static block and add the content you wish:
1
2
3
4
5
6
<div class="sideBox">
    <div class="title">Pay with Paypal!</div>
    <div class="content">
        <img src="{{skin url=""}}images/paypal.gif" alt="Pay with paypal" />
    </div>
</div>
Note:
Don’t forget to choose the store views you wish to enable this static block for.
Now, in order to display the static block, open your CMS page you wish to insert the block into.
1
Admin -> CMS -> Pages -> YOUR_CMS_PAGE -> (left side) Design
Under the design section of your CMS page, chose a layout with column – for example “2 columns with left bar” and under the Layout Update XML section is where you want to enter your static block reference.
1
2
3
4
5
<reference name="left">
    <block type="cms/block">
        <action method="setBlockId"><block_id>payment_box</block_id></action> 
    </block>
</reference>
That’s it :) Save and refresh your website!

1 comments:

Good to learn something new about CMS from this blog. Thanks for sharing such worthy article. By SEO Training in Chennai

August 18, 2015 at 6:26 AM comment-delete

Post a Comment