You have no items in your shopping cart.

Product was successfully added to your shopping cart.

Calling Static Blocks in Header

Calling Static Blocks in Header

When you are trying ot customize parts of magento you also want to add flexibility to your users. Besides custom coding itself, sometimes you want to add a banner or additional menu to your header or footer. In reality, it can be anything else as well (any module or widget), but most common method is to call simple static block.

In order to call out your static block, open either header or footer of your site. You will usually find those files in:

Open the file in dreamweaver preferably and add this line wherever you want your new static block to appear:
<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘banner_image_block_id’)->toHtml() ?>

Please don’t forget to add css to it to match your styling. You would usually just assign a div class action before the call out block.

Topic: Magento 1

Category: Magento 1 Help