How to Call or Create Custom Static Blocks in Magento

In whatever content has your static block has whether it is video, image, text, html, contact form, etc

You can call it in your theme or template (.phtml) by inserting this code

This code will be printed in your template, just ensure that you inserted in a correct html elements

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

But first you need to create static block, to do this from your Dashboard go to

CMS > Static Blocks

custom_static_block must be found in the Identifier* field. See the image below
custom static block

Do a HTML and CSS adjustment after inserting it..

Enjoy coding!

Please click to rate!
About

Elvin is one of the contributors of InnoveDesigns.com. He has been creating Wordpress Plugins, Magento Extensions, & Mobile Applications. If you find this article useful, please Follow him on .

Published under Magento, Web Development Guide