I'm trying to re-order the links in the Customer Account (mysite.com/customer/account/) of my site. I've created:
#app/design/frontend/Mike/sitename/Magento_Customer/layout/customer_account.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Customer My Account (All Pages)" design_abstraction="custom">
<body>
<!-- Removes the My Credit Cards links successfully -->
<referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>
<!-- Won't move the Newsletter Subscription link to the bottom of the nav bar! -->
<referenceBlock name="customer-account-navigation-newsletter-subscriptions-link" after="-"/>
</body>
Any idea why it won't work? Is the order of the links set elsewhere in Magento – in the admin area and stored in the database, for example..? Is there a problem with the XML above?
I've cleaned all cache and have run magento setup:static-content:deploy en_US
but it does nothing. As I've noted in the code snippet, the My Credit Cards link is removed successfully, but the Newsletter link doesn't move anywhere.
Best Answer
Managed to move it by doing something not that obvious... I 'moved' the element from its original location,
customer_account_navigation
, and placed it back there, at the same time telling M2 to place itafter
everything else.Hope this helps someone!