Magento Themes and Magento Extensions

How to Show Static Block in theme Magento

Share

How to Show Static Block in theme Magento

Create an Static Block from your CMS admin tab and show it in your theme.

In my case I wanted to call a Static Block from my theme to show up in the sidebar.

I edited my theme file called 2columns-left.phtml and then added the following code.

Please notice you need to replace the YourBlockId with your own Static Block Id.

<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘YourBlockId’)->toHtml() ?>

Leave a Reply

You must be logged in to post a comment.