Saturday, April 30

How to call a static block from template file in Magento

We can call a static block from template file (.phtml) easily.
First we have to create a static block..

Let us consider we have created a static block with the identifier "myfooter_block"

Now we can call the static block from any .phtml file with the help of following code..

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

hope it helps. Thanks

No comments:

Post a Comment