Friday 7 December 2012

how to call static block in magento


How to call staic block any XML file

<reference name="left">
    <block type="cms/block" name="sample_block" before="-">
        <action method="setBlockId"><block_id>sample_block</block_id></action>
    </block>
</reference>

How to call staick block in your template or .phtml files

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('my_static_block_name')->toHtml() ?>

How to call static block in CMS->Pages

{{block type="cms/block" block_id="your_block_id"}}

No comments:

Post a Comment