0

I would like please your help. I am newbie on Magento 2 and still searching things. I would like to move breadcrumb before title (on category pages, product everywhere). I tried to change it on default.xml <move element="page.main.title" destination="page.top" after="breadcrumbs"/>

but with no luck.

Also i tried to do it from catalog_category_view.xml on vendor/magento/module-catalog/view/frontend/layout but no luck. Can anyone please guide me where can I find the order that is loading?

Can you please help? Thank you in advance

3
  • after updating any content in xml you need to run magento setup:upgrade commands. did you? Nov 27, 2019 at 15:11
  • 1
    <move element="breadcrumbs" destination="page.main.title" before="-"/> use in your custom module not in magento default or vendor modules/files Nov 27, 2019 at 15:20
  • Thank u @Naisapurushotham for you reply, yes i did upgrade but didn't change. Also place it on custom module but nothing. Also i check on incognito but nothing. Nov 28, 2019 at 9:25

2 Answers 2

1

One should not call a title from a breadcrumbs template as this breaks independence.

Instead simply move breadcrumbs on top of main.content container.

<move element="breadcrumbs" destination="main.content" before="-"/>

You can find more info on this at Magento official documentation here : Magento 2 - Reorder recommendation units

0

Try this,

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="page.main.title" destination="breadcrumbs" before="-" />
    </body>
</page>
3
  • Thank you @Jaydeep but i want the opposite i want first the breadcrumb and then the title Nov 28, 2019 at 9:26
  • yeah, you need to use echo $block->getChildHtml('page.main.title'); in everywhere of your breadcrumbs.phtml file Just put that after breadcrumb code. Nov 28, 2019 at 9:31
  • it worked!!!! thank you so muuuuuch. I spent hours searching it!!! Nov 28, 2019 at 14:07

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.