2

I have a custom theme in my magento2 website which is a child of the luma theme.

I need to add in an extra div in the footer for styling purposes but I can't find anywhere in all of the files in the site where this is being created?

    <footer class="page-footer">
        <div class="block ves-menu mgm-widget social-icons " id="footer-social1505690995484902180-menu">
            ... (social links) ...
        </div>
        <div class="widget block block-static-block">
           ... (you can find us) ...
        </div>
        <div class="block ves-menu mgm-widget footer-links " id="footer_menu_links1505690995532534238-menu">
            ... (footer links) ...
        </div>
        <small class="copyright">
            ... (copyright) ...
        </small>
        <div class="widget block block-static-block">
            ... (insta widget) ...
        </div>
</div>

This is how the footer is currently rendered, and I know how to add and remove sections to it in my layout file but I can't workout where to add my extra div in this location;

<footer class="page-footer">
    <div class="footer-inner">
    </div>
</div>
0

You can create default.xml layout from the current theme and add this:

<referenceContainer name="footer-container">
    <container name="footer_inner" as="footer_inner" label="Page Footer Inner" htmlTag="div" htmlClass="footer-inner"/>
</referenceContainer>


Container with a block text inside:

<referenceContainer name="footer-container">
    <container name="footer_inner" as="footer_inner" label="Page Footer Inner" htmlTag="div" htmlClass="footer-inner">
        <block class="Magento\Framework\View\Element\Text" name="your.block.name" before="product.info.price">
            <arguments>
                <argument name="text" xsi:type="string"><![CDATA[<div>Content of your block.</div>]]></argument>
            </arguments>
        </block>
    </container>
</referenceContainer>
  • Is there anything fancy i need to deply this apart from uploading the changes to the site? – MartinaL Sep 26 '17 at 3:01
  • I do not understand what you mean. – St3phan Sep 26 '17 at 7:50
  • St3phan I have added this code and upload the new xml file to my site but it is not rendering on the front end of my website. I have cleared the cached etc but still not rendering the new div – MartinaL Oct 3 '17 at 8:48
  • You must add anything in this container for you to see it. If it is empty, you can't see element. I add new code in my answer with a block inside the container. – St3phan Oct 3 '17 at 8:59

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.