Magento 2 – How to Add a Block to Footer

blocksfootermagento2

how can I add a custom block to the footer. I want to add a new block with new links next to the existing block with the contact links etc and show them beside the default block of the Luma template.

Thanks.

Best Answer

I solved it now by creating a new block in the reference of the footer container of my module default.xml.

<referenceContainer name="footer-container">
    <container name="footer" as="footer" label="Page Footer" htmlTag="div" htmlClass="footer content">

        <block class="Magento\Framework\View\Element\Html\Links" name="footer_company_links">
            <arguments>
                <argument name="css_class" xsi:type="string">footer links</argument>
            </arguments>
        </block>

        <block class="Magento\Framework\View\Element\Html\Links" name="footer_links" after="footer_company_links">
            <arguments>
                <argument name="css_class" xsi:type="string">footer links</argument>
            </arguments>
        </block>    

        <block class="Magento\Theme\Block\Html\Footer" name="copyright" template="html/copyright.phtml"/>

    </container>
</referenceContainer>
Related Topic