Magento: CMS Blocks in Templates

The more I use this code snippet the more I keep having to dig this back up, so I’m posting it here for reference for others as well… Here’s the quick and easy way to insert CMS Blocks into template (.phtml) files without any layout modifications:

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

Enjoy!

Possibly Related Posts:



Leave a Reply

:D :-) :( :o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: