0

I just installed magento2 website, what I want to do is to add "About Us" footer link into the default footer links, from search, what I can achieve is to 1) Create a block 2) Create a widget, then set the widget for all pages, for the footer links Below is what I have completed, but I want to insert the "About Us" directly below the default "Contact Us", is that possible for magento 2? enter image description here

And I am still not know how magento2 generates the default footer links, I cannot figure out from the theme default.xml (/var/www/html/vendor/magento/module-theme/view/frontend/layout)

     <referenceContainer name="footer-container">
        <container name="footer" as="footer" label="Page Footer" htmlTag="div" htmlClass="footer content">
            <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/>
            <block class="Magento\Framework\View\Element\Html\Links" name="footer_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"/>
            <block class="Magento\Framework\View\Element\Template" name="report.bugs" template="Magento_Theme::html/bugreport.phtml" />
        </container>
    </referenceContainer>

Does anybody have insight? Thanks.

0

Create a new custom theme in your magento site - http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-create.html

and add this below code to theme default.xml in layout folder

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="footer_links">            
            <block class="Magento\Framework\View\Element\Html\Link\Current" name="about-us" after="contact-us-link">
                <arguments>
                    <argument name="label" xsi:type="string">About Us</argument>
                    <argument name="path" xsi:type="string">link-to-about-us</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

If you don't know how to create a theme then insert the code in the file you mentioned above after the referenceContainer tag. But it not preferable

Note : after the theme creation you need to run bin/magento setup:content-deploy and clear cache

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.