1

enter image description here

I am trying to get the location of this sidebar list I have shared with the image. where can I get that??

  • is it the custome account section ? – Vivek Kumar Oct 20 at 9:43
4

You can look into this file..

vendor/magento/module-theme/view/frontend/templates/html/collapsible.phtml

This sidebar section coming from here in My Account page.

You can override this file in your custom theme.

app/design/frontend/Vendor/Theme/Magento_Customer/layout/customer_account.xml

Content for this file is

<?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>
        <referenceBlock name="sidebar.main.account_nav">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Magento_Customer::html/collapsible.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

Now you need to create one template file here..

app/design/frontend/Vendor/Theme/Magento_Customer/templates/html/collapsible.phtml

You can copy below file's content there and you can make any modifications there..

vendor/magento/module-theme/view/frontend/templates/html/collapsible.phtml

Hope this will help you!

  • did you tried this then ? – Kishan Savaliya Oct 20 at 10:51
  • thank you, sir. but after applying the method you write above, I lost the sidebar. If you tell me what to do now it would be very helpful. – Chandan Sayed Oct 20 at 10:54
  • Okay give me few mins.. – Kishan Savaliya Oct 20 at 10:54
  • sure, Sir. I am here. – Chandan Sayed Oct 20 at 10:55
  • 1
    Comments are not for extended discussion; this conversation has been moved to chat. – Amit Bera Oct 20 at 13:11
1

vendor\magento\module-customer\view\frontend\templates\account\navigation.phtml is the main file which renders this list, it calls it child blocks to render the individual list items, so the items can be found in the layout file vendor\magento\module-customer\view\frontend\layout\customer_account.xml passed as block arguments to child elements like below ;

<block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-account-link">
                        <arguments>
                            <argument name="label" xsi:type="string" translate="true">My Account</argument>
                            <argument name="path" xsi:type="string">customer/account</argument>
                            <argument name="sortOrder" xsi:type="number">250</argument>
                        </arguments>
</block>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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