1

I'm using Magento 2.3.0, and I'm trying to add a block before the breadcrumbs, without any padding or margin.

I've created a block from the back-end, then my widget using this block, and then placed the widget on Catalog Category, as I want it only on category pages, and as container I picked After Page Header, but that places me the block/widget right after the breadcrumbs, and it also has the padding from the block class, that I don't want, I would like to have it 100% width.

1 Answer 1

2

If default container not working for you, We have always option to add new one. We can add a new container before breadcrumbs in following file

mag2Root/app/design/frontend/{Package}/{theme}/Magento_Theme/layout/default.xml

<referenceContainer name="page.top">
        <container name="before_bread" label="Before Breadcrumbs" htmlTag="div" htmlClass="bread" before="breadcrumbs"/>
</referenceContainer>

Above code will add new container after breadcrumbs. You can select this container for widget container like:

image

Note: for padding/margin/width, you have a new class bread You can adjust as per requirement!

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.