Magento – Static block installed in the header

Who in the header of Magentoshops would like to have some additional information or other things, this can be done relatively easily. Either by header.phtml file in the folder app / design / frontend /[base or default]/[IhrTemplate]/template / page / html rumgeschrieben is directly or also through the introduction of elements with a static block.

For this purpose, the backend CMS > Static blocks to create a new block, contains all the, what is in the header.

Then in the o.g. header.phtml go file and install the following range.

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

In our example, just below the line

<h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class ="logo"><img src ="<?php echo $this->getLogoSrc() ?>" alt ="<?php echo $this->getLogoAlt() ?>" /></a></h1>

Then save, Upload and ready.

Used in Magento 1.5.0.1

Weiterführende Links:

Static block / Static Block in Seite und phtml einbauen

(Static) Show block only on homepage

Statischen CMS Block in Seite / Artikelbeschreibung einbauen

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

Leave a Reply

Your email address will not be published. Required fields are marked *