Adding Breadcrumbs

Updated . Posted . Visible to the public.

Via code (usually in a controller):

$crumbs = Mage::app()->getLayout->getBlock('breadcrumbs');
$crumbs->addCrumb('home', array(
    'label' => 'Home',
    'title' => 'Go to Home Page',
    'link' => Mage::getUrl('')
));

Via Layout XML:

<reference name="breadcrumbs">
    <action method="addCrumb">
        <crumbname>Home</crumbname>
        <crumbinfo>
            <label>Home</label>
            <title>Go to Home Page</title>
            <link>/</link>
        </crumbinfo>
    </action>
</reference>
Mike Whitby
Last edit
Mike Whitby
Posted by Mike Whitby to Magento (2012-03-08 12:04)