Magento :: How To Call Static Blocks From PHTML Pages

Magento offers the web master to put static contents where ever he likes in the site with the help of CMS -> Static Blocks.

These blocks can be easily edited from the admin panel.

To call and show their contents on any phtml file write the following code.


echo $this->getLayout()->createBlock('cms/block')->setBlockId('identifier')->toHtml() ;

Here identifier should be replaced by the identifier of the static block.

Njoy 🙂

Leave a comment

Your email address will not be published. Required fields are marked *