Top links section in Magento is the default block generally used to create a personal area like My Account, My Wishlist, Log in etc. Sometimes you really want to utilize this area to redirect customers to a CMS page which can include some informative details, terms of use or list of products that can help encouraging customers to purchase. This leads you to the use of clickable links in top menu.
Adding clickable links in top links may be a hassle for you but we magicians have deep dived to nail the solution. Here you will find a complete guide to place any links on top links in Magento 2. I have included My Cart, Checkout and My Account for example, you can add more as per your needs.
Learn simple and effective way to add top links in #magento2 https://t.co/bkrn1ecvWx
— MageComp (@theMageComp) February 29, 2016
First of all, go to your custom theme app/desing/frontend/{Vendor}/{theme}/Magento_Theme/layout/default.xml file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<referenceContainer name="header.panel"> <block class="Magento\Framework\View\Element\Html\Links" name="top.links"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="my-link"> <arguments> <argument name="label" xsi:type="string" translate="true">My Cart</argument> <argument name="path" xsi:type="string">checkout/cart</argument> </arguments> </block> <block class="Magento\Framework\View\Element\Html\Link\Current" name="my-link1"> <arguments> <argument name="label" xsi:type="string" translate="true">Checkout</argument> <argument name="path" xsi:type="string">checkout</argument> </arguments> </block> </block> </referenceContainer> <block class="Magento\Framework\View\Element\Html\Link\Current" name="my-link1"> <arguments> <argument name="label" xsi:type="string" translate="true">My Account</argument> <argument name="path" xsi:type="string">customer/account/login/</argument> </arguments> </block> </block> </referenceContainer> |
I would love your comments for any help or suggestions.
I dnt have a vendor and theme folder in my forentend
Great info! Thanks for sharing