Hello Magento Friends,

In today’s blog we will learn about How to Modify Breadcrumb Title on Custom Page using Layout File in Magento 2.

Breadcrumbs are a navigational aid that helps users understand their current location within a website’s hierarchy. In Magento 2, breadcrumbs typically display the trail of pages leading back to the homepage. Magento 2 Breadcrumbs Extension helps to show breadcrumbs on product pages.

Imagine you’ve created a custom page in your Magento 2 store and you want the breadcrumb title to reflect the content of that page instead of the default title. To achieve this, follow these steps:

Steps to Modify Breadcrumb Title on Custom Page using Layout File in Magento 2:

Step 1: First, we need to create a “routes.xml“ file inside our extension at the following path.

app\code\Vendor\Extension\etc\frontend\routes.xml

Then add the code as given below

Step 2: Now, we need to create a controller file inside our extension at the following path.

\app\code\Vendor\Extension\Controller\Index\Index.php

After that add the code as follows

Step 3: Now, we need to create a layout file inside our extension at the following path.

\app\code\Vendor\Extension\view\frontend\layout\extension_index_index.xml

Finally add the below-mentioned code snipppet

Output: 

custom breadcrumb title

Conclusion:

By following the steps outlined in this guide, you can effortlessly tailor the breadcrumb titles to suit the content of your custom pages, enhancing the user experience and navigation within your Magento 2 store.

Also learn,

Happy Coding!

Click to rate this post!
[Total: 0 Average: 0]