Oct 18, 2012

Magento: How to add static block in your template file?

Here we need to do, create static block, and assume we set the "my_test_static_block" as our name/identifier.

As we already created the static block. Place the code below in you template (phtml) file.

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

In you looking how to add static in your layout file you found in this link.


Happy reading.

No comments: