Suppose you have created a static block from Magento administration panel (CMS -> Static Blocks) and you want to render its content in some phtml file. Above code will load the static block by its identifier “footer_links”, then produces and returns block’s html output. <?php echo $this->getLayout()->createBlock('cms/block') ->setBlockId('footer_links') ->toHtml(); ?>
Magento
Magento: Render static block in a phtml file
Suppose you have created a static block from Magento administration panel (CMS -> Static Blocks) and you want to render its content in some phtml file. [source
· 5 min read · By Tahir Yasin
Related posts
Magento
Get Magento root category id
Learn how to retrieve the root category ID in Magento 1, understand the category hierarchy, avoid inefficient database queries, and use Magento’s built-in methods for cleaner, faster store development.
Magento
Get Magento Website Meta Data and Config Values
Following functions will help you to get Magento meta data like “Default Title”, “Default Description” To get Default Title: [code langu
Magento
Add Home link in Magento top navigation menu
Learn how to easily add a Home link to the Magento top navigation menu using simple template changes and PHP code. By default there is no Home link in Magento top navigation menu but you can easily add it yourself.