May
18
2009
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:
- Magento Commerce Error Reporting Tip
- Eclipse + ZendStudio + ZendServer + Android SDK = Awesome IDE
- Magento: Paypal Standard IPN Double Totals Bug 1.3.2.3 + fix
- iPhone Magento theme compatible with Android
- Magento Tutorial Video: Display Product Images in Blocks and Pages