Magento 2.1 – How to Add Breadcrumbs in My Account Pages

breadcrumbsfrontendlayoutmagento-2.1xml

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?

Best Answer

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

Related Topic