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:


This entry was posted in Magento Commerce and tagged , , . Bookmark the permalink.

Comments are closed.