2

I want to add Breadcrumbs in my account page & it should be displayed on every tab selection below the Navigation menu bar.

But it is not showing anything on my page it is looking like this

enter image description here

But when I am watching for the hints it is showing me like this enter image description here

Which means breadcrumb is there but then why it is not showing there? I want it to be shown like this

enter image description here

How could I get this to be done?

  • remove your above xml and check where display your breadcrumbs? – Rakesh Jesadiya Oct 12 '17 at 9:38
7

Breadcrumbs need to be added for each action. For example for customer_account_create.xml

<referenceBlock name="breadcrumbs">
    <action method="addCrumb">
        <argument name="crumbName" xsi:type="string">account</argument>
        <argument name="crumbInfo" xsi:type="array">
            <item name="title" xsi:type="string" translate="true">Account</item>
            <item name="label" xsi:type="string" translate="true">Account</item>
            <item name="link" xsi:type="string">/customer/account</item>
        </argument>
    </action> 
    <action method="addCrumb">
        <argument name="crumbName" xsi:type="string">account.create</argument>
        <argument name="crumbInfo" xsi:type="array">
            <item name="title" xsi:type="string" translate="true">New Customer</item>
            <item name="label" xsi:type="string" translate="true">New Customer</item>
            <item name="last" xsi:type="boolean">true</item>
        </argument>
    </action>
</referenceBlock>

More detail You can look at the github in module Breadcrumbs

  • Do I need to put this xml for every tabs by making there own xml file or how could I get this because as I will select different tabs in customer account It should get changed – Abhishek Tripathi Oct 12 '17 at 10:34
  • Yes, for every tabs and actions (about 25) needed independent xml. Filenames XML You can find in the directory view\frontend\layout of modules customer, sales, review, wishlist, downloadable, etc. – Vitalii Oct 12 '17 at 11:10
  • the breadcrumbs are ready but when I click on the link like here the account will bi the link so it should needed to go on the account page means on the dashboard of the customer but it showing the wrong link to me – Abhishek Tripathi Oct 12 '17 at 11:30
  • what should be the right link? – Vitalii Oct 12 '17 at 11:59
  • the right link should be localhost/magento_test/customer/account as of magento_test is my root directory of magento but it is not taking it into the link consideration – Abhishek Tripathi Oct 12 '17 at 12:03
2

I am putting this answer because It is working properly with this code & the links are also clickable & goes to the right place when we click.

<referenceBlock name="breadcrumbs">
            <action method="addCrumb">
                <argument name="crumbName" xsi:type="string">home</argument>
                <argument name="crumbInfo" xsi:type="array">
                    <item name="title" xsi:type="string" translate="true">Home</item>
                    <item name="label" xsi:type="string" translate="true">Home</item>
                    <item name="link" xsi:type="string">{{baseUrl}}</item>
              </argument>
            </action> 
            <action method="addCrumb">
                <argument name="crumbName" xsi:type="string">account</argument>
                   <argument name="crumbInfo" xsi:type="array">
                      <item name="title" xsi:type="string" translate="true">Account</item>
                      <item name="label" xsi:type="string" translate="true">Account</item>
                      <item name="link" xsi:type="string">{{baseUrl}}/customer/account</item>
                  </argument>
            </action> 
            <action method="addCrumb">
                <argument name="crumbName" xsi:type="string">orders</argument>
                  <argument name="crumbInfo" xsi:type="array">
                    <item name="title" xsi:type="string" translate="true">My Orders</item>
                    <item name="label" xsi:type="string" translate="true">My Orders</item>
                    <item name="last" xsi:type="boolean">true</item>
                </argument>
            </action>
        </referenceBlock>

Note: you need to add this code as per your requirement in each & every page's layout.xml for getting breadcrumbs there into that page the above example is for sales_order_history.xml(My Orders)

  • When I add the breadcrums on the customer_account.xml he removes menu items on the left? For example newsletter subscriptions. Weird – Sander van Zuidam Mar 11 at 19:30
  • may be you have called your breadcrumb block at wrong position so please find it & move it to the appropriate place & then try with it – Abhishek Tripathi Mar 12 at 3:28

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.