0

How to reorder my account sidebar nav link in Magento2

  1. ACCOUNT DASHBOARD
  2. MY ORDERS
  3. ADDRESS BOOK
  4. ACCOUNT INFORMATION
  5. MY PRODUCT REVIEWS
  6. NEWSLETTER SUBSCRIPTIONS

How to Re arrange the nav links.

1 Answer 1

0

We can rearrange these links by using the "move" element in your layout file (customer_account.xml).

File path, if you are working in your custom theme: app/design/frontend/{vendor}/{themename}/Magento_Customer/layout/customer_account.xml

OR

File path, if you are working in your custom module:
app/code/{Vendor}/{Module}/view/frontend/layout/customer_account.xml

Code:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="customer-account-navigation-account-edit-link" destination="customer_account_navigation" before="-"/>
        <move element="customer-account-navigation-orders-link" destination="customer_account_navigation" after="customer-account-navigation-account-edit-link"/>
    </body>
</page>

And the same with remain links you would like to sort. "customer-account-navigation-account-edit-link", "customer-account-navigation-orders-link" is the block name in layout, with the help of "before" and "after" element.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.