Question

where it Is made Breadcrumb Array in Magento 2.3.1?

In Detail page has show Breadcrumb but i m not able to find where it Is made Breadcrumb Array

enter image description here

Can somebody help me?

Thanks

Was it helpful?

Solution

For product page breadcrumbs loading from

https://github.com/magento/magento2/blob/2.3/app/code/Magento/Catalog/view/frontend/web/js/product/breadcrumbs.js

function _resolveCategoryUrl

Basically the code is checking if category path included in url then its creating breadcrumbs path from url, otherwise it will check for referral url and if referral is category url then it will find category title and url from menu dropdown

See function _resolveCategoryCrumbs

So if category is not included in menu then it won't show breadcrumbs!

OTHER TIPS

There are quite a few places. Breadcrumbs are used almost identical as they were in Magento 1.

The module responsible with them is: Magento_Theme. They are added to the layout in:

vendor/magento/module-theme/view/frontend/layout/default.xml

Block:

vendor/magento/module-theme/Block/Html/Breadcrumbs.php

Template:

vendor/magento/module-theme/view/frontend/templates/html/breadcrumbs.phtml

Now, each module that renders pages, can modify/add what breadcrumbs they want.

As I can see, you are interested in product page. That is rendered "_prepareLayout()" from:

vendor/magento/module-catalog/Block/Breadcrumbs.php

If you want to find them all, just search all the magento vendor module for:

->addCrumb(

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top