How to show breadcrumbs on product page In Magento 2?
Magento breadcrumbs are a navigational tool to improve customer experiences. They are displayed at the top of web pages to let users see how they arrived at their current page. Breadcrumbs use the page name followed by the ">" symbol, i.e., home>clothes>sweaters> All crumbs should be linked to the corresponding page.
Magento 2 lets users add breadcrumbs to product pages and pages from the content management system (CMS). Custom pages require code to display breadcrumbs.
How to Add Magento 2 Breadcrumbs on a Product Page
Breadcrumbs on a product page are enabled by default in Magento 2.3.3 or higher. Magento 2 shows full breadcrumbs on a product page if navigation uses categories. If you navigate using product URLs, the full breadcrumb may not show.
Not all themes support the default settings for product pages. Inserting the following code into a product page layout (XML) file should enable breadcrumbs:
<referenceBlock name="breadcrumbs" template="Magento_Theme::html/breadcrumbs.phtml"/>
<block class="Magento\Catalog\Block\Breadcrumbs"/>
For nonprogrammers, an experienced Magento developer can customize a Magento 2 breadcrumbs product page.
Does Magento 2 Add Breadcrumbs to a Custom Page?
Adding custom pages to Magento 2 requires XML layout and configuration files.
- Page configuration files contain a page's detailed structure and content. They are usually located under the module or theme directory.
- Page layout files use one of five Magento layout types. Layout files appear under the module or theme directory.
Coding changes are required to add breadcrumbs to a custom page.
How to Add Breadcrumbs to CMS Pages
Breadcrumbs can be placed on CMS pages by changing the Magento 2 breadcrumbs settings through the Admin panel.
- Go to Stores on the Admin Panel.
- Select Settings > Configuration.
- Choose Web under the General heading.
- Expand the default Pages section.
- Navigate to the Show Breadcrumbs for CMS Pages.
- Uncheck the Use system value box.
- Select Yes from the dropdown.
- Choose Save Config.
You may need to flush the cache to display the changes.
Managing Breadcrumbs in Magento 2
Our Hyva theme and extensions may provide the tools you need to add breadcrumbs to Magento 2 product, custom, and CMS pages. If you require a more customized solution, our Magento development services can help.
Login and Registration Form