0

So I have a Magento Open Source 2.1.9 site that for the most part is working however, we have started to create several landing pages for our root categories, and they work great. For example: We have a landing page for Automotive Parts. One of the links from that landing page is for exhausts. If someone clicks on Exhaust, the breadcrumbs show up as:

home > automotive parts > exhausts

The problem is that if they click on the automotive parts link, it brings them to that categories page, NOT the landing page. Is there a way to either A) Replace the category page with a permanent link to the landing page (I've tried a url-rewrite, but it doesn't seem to work), or B) replace the breadcrumb link to the automotive parts landing page.

1 Answer 1

0

You have to find the XML file where the breadcrumbs come from, it has to look like this:

<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">Home</item>
            <item name="label" xsi:type="string">Home</item>
            <item name="link" xsi:type="string">{{baseUrl}}</item>
        </argument>
    </action>
    <action method="addCrumb">
        <argument name="crumbName" xsi:type="string">automotive parts</argument>
        <argument name="crumbInfo" xsi:type="array">
            <item name="title" xsi:type="string">automotive parts</item>
            <item name="label" xsi:type="string">automotive parts</item>
            <item name="link" xsi:type="string">{{baseUrl}}wherever/the/url/goes</item>
        </argument>
    </action>
    <action method="addCrumb">
        <argument name="crumbName" xsi:type="string">exhausts</argument>
        <argument name="crumbInfo" xsi:type="array">
            <item name="title" xsi:type="string">exhausts</item>
            <item name="label" xsi:type="string">exhausts</item>
        </argument>
    </action>
</referenceBlock>

Add your path to the last item of the second action which has the name="link".

Your Answer

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

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