How to Add Static Block to your 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.

getLayout()->createBlock('cms/block')->setBlockId('YourBlockId')->toHtml() ?>

About Rick

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.
5 comments

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*