How To Add A Navigation Link In My Account On Magento 2
In today post, I will guide you on how to add navigation to your customer’s account dashboard.
How to add a Navigation Link in My Account
Step 1: Create a file in your theme
Before making any customization, the first thing you would have to do is create a
customer_account.xml in your theme. Follow this:
Step 2: Add Custom Link
In this step, the only thing that you would have to do is adding this code to your layout xml file:
<referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-custom-link" after="-" > <arguments> <argument name="label" xsi:type="string" translate="true">Custom Link Label</argument> <argument name="path" xsi:type="string">custom-path</argument> </arguments> </block> </referenceBlock>
Hope that after reading this, you will be able to add the navigation links to your account with ease.
Enjoyed the tutorial? Spread it to your friends!