How to add static block in magento?

This blog is dedicated on how to add static block in magento?
Yes, we can include any static block in phtml files. I order to achieve this first you have to create the static block using magento admin panel and then include this static block into the magento. There are different ways we can add static blocks. yet another attempt to explain with quick and easy examples.

Example 1: how to include static block in phtml file?
Let us suppose, you have created static block with identifier “promo_block” in magento admin.
Now, you can call the static block from any phtml file with the help of following code:

  echo $this->getLayout()->createBlock('cms/block')->setBlockId('promo_block')->toHTML();

Example 2: How to include static block on product view page?
We will refer the same static block “promo_block”. Now open “catalog.xml” file from current theme folder ( and search for string “”.
You can add following code just before closing tag of product view page. we are adding “promo_block” static block into right reference. However you can add this block into any area like “content”, “left”, etc

Share this nice post:

16 thoughts on “How to add static block in magento?

    1. Thanks jhett, while writing i never thought that i would get hits so early.
      Its just experience i am sharing with open source community :)

  1. This is the best blog for anyone who needs to find out about this topic. You understand so much its nearly exhausting to argue with you (not that I truly would need?HaHa). You positively put a new spin on a topic thats been written about for years. Great stuff, just nice!

  2. Thanks again for considering readers much like me, and I hope for you the best of achievements like a professional in this field.

  3. Heya i’m for the first time here. I came across this board and I find It really useful & it helped me out a lot. I hope to give something back and help others like you helped me.

  4. I’d have to check with you here. Which is not something I usually do! I enjoy reading a post that will make people think. Also, thanks for allowing me to comment!

  5. I just want to tell you that I’m new to blogging and definitely savored you’re blog site. Probably I’m likely to bookmark your blog post . You amazingly have excellent posts. Bless you for sharing your web-site.

  6. An interesting discussion is worth comment. I believe that it’s best to write extra on this subject, it may not be a taboo subject however usually individuals are not sufficient to speak on such topics. To the next. Cheers

  7. Aw, this is a very nice post. Within plan I would likely like to place in writing similar to this also spending time along with real efforts to generate a great article… although exactly what do I say… I waste time alot and also by no means apparently get something done.

  8. Heya i’m for the first time here. I found this board and I to find It truly useful & it helped me out a lot. I’m hoping to offer one thing back and aid others like you helped me

Comments are closed.