Question

In my magento2 based website I have a static block that i want to load right before the footer block but below the main content of the page. I have tried the below but that did not seem to make it load anywhere. I also tried replacing the name value in the referenceContainer to footer but then that put the static block inside the footer which is not what I want because I want/need this static block to be full width of the page and not contained within any other div.

thoughts on how to achieve this?

<referenceContainer name="page.main">
<block class="Magento\Cms\Block\Block" name="muah_landingpg_footer_banner" after="-">
    <arguments>
        <argument name="block_id" xsi:type="string">muah_landingpg_footer_banner</argument>
    </arguments>
</block>

Was it helpful?

Solution

Can you please try this ?

<referenceContainer name="page.wrapper">
    <block class="Magento\Cms\Block\Block" name="muah_landingpg_footer_banner" before="page.bottom">
        <arguments>
            <argument name="block_id" xsi:type="string">muah_landingpg_footer_banner</argument>
        </arguments>
    </block>
</referenceContainer>

OTHER TIPS

Try with container page.bottom. Take a look at vendor/magento/module-theme/view/frontend/layout/default.xml to see more details.

For example:

<referenceContainer name="page.bottom">
    <block class="Magento\Framework\View\Element\Template" name="test.data" template="Vendor_PageLayout::test.phtml"/>
</referenceContainer>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top