Skip to content

Instantly share code, notes, and snippets.

@magevision
Created October 1, 2021 09:51
Show Gist options
  • Save magevision/d2d2d6ec0798ee728e36215acbb3dd8f to your computer and use it in GitHub Desktop.
Save magevision/d2d2d6ec0798ee728e36215acbb3dd8f to your computer and use it in GitHub Desktop.
How to Add a Custom Link in My Account Navigation
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="customer_account_navigation">
<block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-custom-link">
<arguments>
<argument name="label" xsi:type="string" translate="true">Custom Link Label</argument>
<argument name="path" xsi:type="string">module/controller/action</argument>
<argument name="sortOrder" xsi:type="number">300</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment