addCrumb ($crumbName, $crumbInfo, $after=false)
There are two ways to add crumb i.e. one by xml layout and another by using code:
By using code we can add breadcrumb like this:
$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('Fruits', array('label'=>'Fruits',
'title'=>'All Fruits',
'link'=>'http://magento.com/moduleName/fruits'));
$breadcrumbs->addCrumb('types', array('label'=>'Apple',
'title'=>'Apple'));
echo $this->getLayout()->getBlock('breadcrumbs')->toHtml();
By using layout xml,for example,we want to add crumb in a custom about us page:
<aboutus_index_index translate="label">
<reference name="breadcrumbs">
<action method="addCrumb">
<name>aboutus</name>
<params>
<label>AboutUs</label>
<title>AboutUs</title>
<link> aboutus.html</link>
</params>
</action>
</reference>
</aboutus_index_index>
If you have any further queries,please feel free to comment on it.
Share this on Facebook
Tweet this
I remember those moment while I'm eating bread and breadcrumbs were falling on my feet. Even a small non-sense move of every particles on this world could highly contribute in the development human business and so with the development of human's living in the world.