Magento – Static block / Static Block in Seite und phtml einbauen

If you would like to install additional static blocks in his front, can do this quickly by first of each static block is created. Here, the page identifier / code to be the one, will be called later.

Then only the following line in the PHTML file in place install and off you go:

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

If you want to your own style sheet / CSS entry for this block use, Of course it can be provided with a separate class. As an example,:

<div class ="shortlinks">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_test')->toHtml() ?>
</div>

Then in the can. Css file, the class “shortlinks” be defined.

Used in Magento versions 1.4.1.1 and 1.5.1.0 Comments? Additions? Notes? Gladly!

Weiterführende Links:

(Static) Show block only on homepage

Statischen CMS Block in Seite / Artikelbeschreibung einbauen

Static block installed in the header

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.

4 comments on “Magento – Static block / Static Block in Seite und phtml einbauen”

  1. How can you in a static block include a .phtml file?
    For me it does not work with the following line, although it should work:
    {{block type=”core/template” template =”page/subcategory.phtml”}}

    1. Hi,
      I am a bit confused. The above line does not have much to do with a static block. As in the o.g. to read instructions, should the line getLayout()->createBlock(&#8216;cms/block&#8217;)->setBlockId('EigenerSeitenbezeichner')->toHtml() ?Install> in the file.
      This should then fold.

  2. neee, thats not what I meant. under CMS>Static blocks I have created a block and o.g. Line is inserted there. In the categories I have given this static block, so that static block is loaded on the categories pages.
    Only the .phtml file is not loaded,although it is present. 🙁

Leave a Reply

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