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 🙂

This entry was posted in Magento, PHP and tagged , . Bookmark the permalink.

Leave a Reply

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