I would like to add block to the website (in general on every page) just below menu but not into header, "root" eventually "content".

I managed to add it into content but it's not what I wanted.

=> My layout :

    <reference name="content">
        <block type="core/template" name="banman" before="-" template="banman/block.phtml"/>

This is what I needed to put it there.

Because I'm using Ultimo(latest version), there is a slider before everything else.

Slider is in "root" so I was thinking if I change "content" into "root" then I'll be able to position it before or after slider but it does not work.

I can add it into top.container and it works pretty. But, I can't move it before breadcrumbs.

Doesn't like how it look like if I place it inside menu.Menu bar is far too high.

1 Answer 1


If you want to add your new block in all pages after the breadcrumbs:

1) app/design/frontend/{package}/{theme}/layout/local.xml

    <reference name="root">
        <block type="core/template" name="banman" template="banman/block.phtml"/>

2) app/design/frontend/{package}/{theme}/template/page/1column.phtml

add this:

<?php echo $this->getBlockHtml('banman') ?>

after this:

<?php echo $this->getChildHtml('breadcrumbs') ?>

NB: If you want that your block will be just displayed in some page, the same thing but the xml will be changed like this:

    <reference name="root">
        <block type="core/template" name="banman" template="banman/block.phtml"/>


To display your block with a condition configuration, you have to add your config field in system.xml a multiselect choice to tel to Magento in wich page you want to display your block something like this:

    <displayblock translate="label">
        <label>Where you want to display the banman block</label>

You have an exemple here

NB: Dont forget to add this in app/design/frontend/{package}/{theme}/template/page/1column.phtml

    <?php echo $this->getBlockHtml('banman') ?>


how to insert my block without changing local.xml

Go to your phtml where you want to display your block and add this, you dont need with this the xml

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('path_to_your_block')->toHtml(); ?>

You can set the createBlock('block/type') with your block type.

  • I would like to have it on every page (depending on configuration - will or will be not displayed on every page or only on selected pages).
    – Rob D. A.
    Jan 3, 2018 at 9:37
  • Module I developed allow you to display element on home page and on every other page and it actually works except the place where this element should be displayed. This is the only thing I must sort out. So far I can insert my block directly either into content or top.container only :( If possible I would like to be able insert it anywhere else without changing local.xml or 1pagexxx.phtml. Is it possible in Magento ?
    – Rob D. A.
    Jan 3, 2018 at 9:41
  • I dont know your module and where is this config, but if you want ofcourse display this block with some config you have to create in this module a new config in system.xml to have the entry config in BO, you have to use getStoreConfig() method, look my edit
    – PЯINCƎ
    Jan 3, 2018 at 9:46
  • look my edit please
    – PЯINCƎ
    Jan 3, 2018 at 9:53
  • I think this might be very useful however more important is how to insert my block without changing local.xml. I would like to have everything just/only in my module.
    – Rob D. A.
    Jan 3, 2018 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.