phprockers-logo

Display the custom file in cms block to frontend/backend in Magento

0 comments
Below coding can be used to show CMS block in Frontend.

Ref. Path :  app/design/frontend/base/default/template/callouts/left_col.phtml or right_col.phtml.

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

Setting in Backend:

First Go to CMS and create a static page. Here we take "identifier" id from static block and put this id to above coding inside setBlock_id. And inside content we have put following line for calling our own block coding file,

{{block type="core/template" name="leftnav_menu" template="menu/menu.phtml"}}

Finally we have saved the file and this file is running in frontend inside the block.