PHP Magento Tips

Powered by Blogger.

Add Breadcrumbs to your Custom Module in Magento

Rate this posting:

If you are creating a custom module in Magento with front end page, then this post will help you to create your breadcrumb for your custom page.

Method 1:

For front end check _prepareLayout() function inside your app/code/local/{namespace}/{modulename}/Block/{entity}.php

inside this function you can define your breadcrumb as per below:

protected function _prepareLayout()


        $breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');

        $breadcrumbs->addCrumb('home', array('label'=>Mage::helper('cms')->__('Home'),'title'=>Mage::helper('cms')->__('Home Page'), 'link'=>Mage::getBaseUrl()));

        $breadcrumbs->addCrumb('an_alias', array('label'=>'My label', 'title'=>'My Title'));


         return parent::_prepareLayout();


Method 2:

you can also add your custom breadcrumb code under your front end layout.xml file

In that file add below code:

<reference name="root">


   <action method="unsetChild">



   <block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs">

    <action method="addCrumb">








    <action method="addCrumb">

     <breadcrumbName>NEW PAGE NAME</breadcrumbName>


      <label>NEW PAGE Label</label>

      <title>NEW PAGE Title</title>





Tag : Magento
1 Comments On "Add Breadcrumbs to your Custom Module in Magento"

How To Get Products Breadcrumb Of Searched Products In PDP Page?

Back To Top