1

I want to add a banner to the top of all the product pages. So far I've added

<referenceContainer name="columns.top">

to the default.xml that links to my template file. This displays the banner, but its under the breadcrumbs and is screwing with the block titles on some of the static pages.

Where should I reference to have my banner above the breadcrumbs, but below the navigation?

2

The breadcrumbs block is a child block of the page.top container which is itself placed just after header.container

It is declared under Magento\Theme\view\frontend\layout\default.xml:

<referenceContainer name="page.top">
     ...
     <block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
</referenceContainer>

To place your block before the breadcrumbs you can do the following:

<referenceContainer name="page.top">
    <block class="My\Block\Class" name="my_block" before="breadcrumbs" />
</referenceContainer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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