How to Find out where it Is made Breadcrumb Array in Magento 2.3.1
-
01-03-2021 - |
Soluzione
For product page breadcrumbs loading from
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!
Altri suggerimenti
for product page, https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/view/frontend/templates/product/breadcrumbs.phtml
it is calling below js file https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/view/frontend/web/js/product/breadcrumbs.js
and it is creating json from below file https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php#L104
hope it will clear your doubts.
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(