Call Static Blocks From Any PHTML File in Magento

Wednesday, December 14, 2011
In this article i am going to show you...How to call a static block from any template(.phtml) file in Magento.You can easily call any static block from template (phtml) file. At first, you have to create a static block from admin, CMS->Static Blocks .
Let us suppose, you created a static block with the identifier footer_links.
Now, you can call the static block from any phtml file with the help of following code:
<?php echo $this->getLayout()->createBlock('cms/block')
->setBlockId('footer_links')->toHTML();?>

0 comments:

Post a Comment