0

I want to add breadcrumbs for my faq page like this:

Home -> Pages -> FAQ

but when I call breadcrumb from Magento_Theme module, it's just show Home -> FAQ.

Any suggestions for this issue?

Many thanks.

2
  • which magento version
    – Amit Bera
    Nov 27, 2019 at 9:17
  • i'm using version 2.1
    – trem jenny
    Nov 27, 2019 at 17:46

1 Answer 1

1

Try below in your layout file

<referenceContainer name="page.wrapper">
<referenceBlock name="breadcrumbs" remove="true"/>
<referenceContainer name="page.top">
    <block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs.cms">
        <action method="addCrumb">
            <argument name="crumbName" xsi:type="string">Home</argument>
            <argument name="crumbInfo" xsi:type="array">
                <item name="title" xsi:type="string">Home</item>
                <item name="label" xsi:type="string">Home</item>
                <item name="link" xsi:type="string">/</item>
            </argument>
        </action> 
        <action method="addCrumb">
            <argument name="crumbName" xsi:type="string">Pages</argument>
            <argument name="crumbInfo" xsi:type="array">
                <item name="title" xsi:type="string">Pages</item>
                <item name="label" xsi:type="string">Pages</item>
            </argument>
        </action>
        <action method="addCrumb">
            <argument name="crumbName" xsi:type="string">FAQ</argument>
            <argument name="crumbInfo" xsi:type="array">
                <item name="title" xsi:type="string">Faq</item> 
                <item name="label" xsi:type="string">Faq</item> 
            </argument>
        </action>
    </block>
</referenceContainer>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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