I want to change magento 2 customer navigation sidebar menu title.
for example: Account information turns into My Profile
What I've done so far:
customer_account.xml
<?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" label="Customer My Account (All Pages)" design_abstraction="custom">
<body>
<referenceContainer name="sidebar.main">
<block class="Magento\Framework\View\Element\Html\Links" name="customer_account_navigation" before="-" cacheable="false" template="Magento_Customer::account/navigation.phtml">
<referenceBlock name="customer-account-navigation-account-link" remove="true"/>
<referenceBlock name="customer-account-navigation-account-edit-link">
<arguments>
<argument name="label" xsi:type="string" translate="true">My Profile</argument>
<argument name="path" xsi:type="string">customer/account/edit</argument>
</arguments>
</referenceBlock>
</block>
</referenceContainer>
</body>
</page>
Best Answer
The reason why it's not working is because it's getting overwritten in the luma theme.
If you want to change that, create a theme that extends the luma theme and change it there.
Check the file under
theme-luma/Magento_Customer/layout/customer_account.xml
If you change it there it will work, but.. you don't wanna change that directly in the luma theme.. ;) so extend the theme and voilĂ !
Create a custom theme and activate it. Make sure it's a child of the
luma theme
then create the file in your new theme Magento_Customer/layout/customer_account.xml with these contents :