Showing posts with label display static block with title in phtml file : Magento. Show all posts
Showing posts with label display static block with title in phtml file : Magento. Show all posts

Friday, 29 January 2016

How to display static block with title in phtml file : Magento

If you want to display static block in PHTML file in Magento. We can use following code:


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



But If you want to display static block with title. So, we can you following code:


<?php
     $block = Mage::getModel('cms/block')--->load('identifier');
     echo $block->getTitle();
     echo $block->getContent();
?>