How to call a static block in Magento

How to call a static block in Magento

There are two ways of calling a static block in magento:

First through Layout XML files, second through phtml file.

XML Method:

In the layout (app/design/frontend/default/your_theme/layout/local.xml),add the follwing code:

    <cms_page> <!-- need to be redefined for your needs -->
        <reference name="content">
            <block type="cms/block" name="cms_news" as="cms_news">
                <action method="setBlockId"><block_id>news</block_id></action>

In the phtml file call:

<?php echo $this->getChildHtml('news'); ?>


PHTML File Method:

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

Please contact us at or call us at +91-8800519180 for any support related to Magento. You can also visit the Magento development page to check the services we offer.