1

How can I set a custom external link in the footer?

Something like blog.example.com with the label of "Blog" <a href="blog.example.com">Blog</a>

I have added other links to my footer via this way.

<referenceBlock name="footer">
            <block class="Magento\Cms\Block\Block" name="footer_social_links_block">
                <arguments>
                    <argument name="block_id" xsi:type="string" translate="true">dth_footer_social_links</argument>
                </arguments>
            </block>
</referenceBlock>

I am using Magento 2.0.7 right now.

What if I use this block instead? How could I link externally from this? I setup a returns-policy link already - but it is internal. Returns and Exchanges returns-policy

1

You can add it by default way

<referenceBlock name="footer_links">
    <block class="Magento\Framework\View\Element\Html\Link\Current" name="footer_blog_link" before="-">
        <arguments>
            <argument name="label" xsi:type="string" translate="true">Blog</argument>
            <argument name="path" xsi:type="string">http://blog.example.com</argument>
        </arguments>
    </block>
</referenceBlock>
| improve this answer | |
  • I would prefer this more than static block solution. Trying now. – camdixon Nov 7 '16 at 13:15
1

You have to create one block, I think you have already created block,

dth_footer_social_links open block in backend,

You can set your anchor link directly in static block,

<a href="http://blog.example.com">Blog</a>

Save Block and check in your footer. BLog Link are display.

| improve this answer | |
  • Valid point here, but I don't want to use that block. I will do another static block and let you know. – camdixon Nov 7 '16 at 12:23
  • create other block and check, if any problems let me know – Rakesh Jesadiya Nov 7 '16 at 12:27
  • I used your exact code in my static block. It sent me here https://example.com/blog.example.com – camdixon Nov 7 '16 at 12:48
  • try with this url,blog.example.com – Rakesh Jesadiya Nov 7 '16 at 12:51
  • I did - here is what I put in static block - <a href="blog.example.com">Blog</a> I updated question with a "footer_links" section. Could I use this? – camdixon Nov 7 '16 at 12:53

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.