Categories

Featured templates

Magento. How to add a new static block to the header/footer section

Ray Taylor August 24, 2015
Rating: 3.2/5. From 5 votes.
Please wait...

In this tutorial you will learn how to add a static block to the header/footer section in Magento.

Magento. How to add a new static block to the header/footer section

  1. Log into your Magento Admin panel and navigate to CMS -> Static Blocks

    .

  2. Click on Add New Block button:

    magento_how_to_add_a_new_static_block_to_the_Header_Section_1

  3. Specify your Block Title and Block Identifier.

  4. Remember or copy your Identifier.

  5. Select the store view for which you want to add this Static block and alter the Content Field:

    magento_how_to_add_a_new_static_block_to_the_Header_Section_2

  6. Using your FTP client or any FileManager, navigate to app\design\frontend\default\themeXXX\template\page\html folder.

  7. Open header.phtml file using any text editor.

  8. Depending on where exactly you wish to place your Static Block, paste the following code:

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

    where custom_block_id is your identifier which you’ve indicated when creating the Static Block:

    magento_how_to_add_a_new_static_block_to_the_Header_Section_3

  9. Save this file and upload to the server.

  10. Reload your site to see the changes.

Thank you for reading this tutorial. Now you know how to add a static block to the header section in Magento.

Feel free to check the detailed video tutorial below:

Magento. How to add a new static block to the header/footer section

Ecommerce Magento Templates
This entry was posted in Magento Tutorials and tagged add, block, footer, header, Magento, static. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket