Magento call static block in .phtml file.

First you need to create a static block in admin section.
Go to Admin >> CMS >> Static Blocks  . After create static block use identifier block name

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('you're_identifier_block_name')->toHTML(); ?>


If you want to call static block through XML file.

<reference name="right">  
        <block type="cms/block" name="block_name" as="block_name">  
           <action method="setBlockId"><block_id>you're_identifier_block_name</block_id></action>  
        </block>  
</reference>

No comments:

Post a Comment