0

I would like to add some content to the footer.

enter image description here

I followed few tutorials and was able to edit (remove some and add some others) default footer links by editing the file:

website-root/app/design/frontend/MJ/theme/Magento_Theme/layout/default.xml

And I was able to add extra content to footer from:

Admin: Content > Blocks > Add New Block

and then reference that block from a Widget. The Widget was set up to appear in the container: Page Footer

enter image description here

and it showed to right under subscribe button as seen in the image above.

I tried changing the container to Page Footer Container

enter image description here

but it showed just under existing links.

enter image description here

I still have a lot to learn while customizing this theme, therefore, I would appreciate any insights you could provide into how to handle this in Magento.

2 Answers 2

3

Remove Default Footer in default.xml file

<referenceContainer name="footer" remove="true"/>

And also Add following code in default.xml

<referenceContainer name="footer-container">
           <block class="Magento\Theme\Block\Html\Footer" name="footer_block" as="footer_block" template="html/footer.phtml"/>
        </referenceContainer>

And add static block in your theme file footer.phtml

$block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('your_block_id')->toHtml();
2
  • Thank you for your reply. I ended up removing the footer and making footer HTML as a Content Block and styled it with CSS. Mar 12, 2018 at 5:46
  • @MohammedJoraid please add your solution as an answer and accept it. Thank you! Sep 21, 2020 at 10:59
1

Remove default links:

<referenceBlock name="footer_links" remove="true"/>

And put your block into this:

<referenceContainer name="footer">              
    <block class="Magento\Cms\Block\Block" name="custom_links" before="-">
        <arguments>
            <argument name="block_id" xsi:type="string">custom_links</argument>
        </arguments>
    </block>            
</referenceContainer>
1
  • 1
    Thank you for your reply. I ended up removing the footer and making footer HTML as a Content Block and styled it with CSS. Mar 12, 2018 at 5:46

Your Answer

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

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