Magento: How to call static block from template file?
You can easily call any static block from template (phtml) file. At first, you have to create a static block.
Let us suppose, you created a static block with the identifier cool_items.
Now, you can call the static block from any phtml file with the help of following code:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('cool_items')->toHTML();?>
Related posts:
- Magento: How to call block directly from phtml file without defining in layout?
- Magento: Create CMS Page & Static Block programmatically
- Magento: Block Controller Model Helper Override
- Magento: Fatal error: Call to a member function getTable() on a non-object
- Magento: Fatal error: Call to a member function setSaveParametersInSession() on a non-object
- Magento: How to upload file?
- jQuery: Grey out background and preview image as popup
- Installing the Smarty Template Engine
- An Introduction to Smarty Template Engine
- Magento: Adding attribute from MySql setup file
