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.

  1. Go to Stores on the Admin Panel.
  2. Select Settings > Configuration.
  3. Choose Web under the General heading.
  4. Expand the default Pages section.
  5. Navigate to the Show Breadcrumbs for CMS Pages.
  6. Uncheck the Use system value box.
  7. Select Yes from the dropdown.
  8. 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.

Loading

Didn’t you find the answer to your question? We are always happy to help you out.

Loading
Loading