Adding Breadcrumbs

Posted almost 11 years ago. 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>
Avatar
Mike Whitby
Last edit
About 8 years ago
Mike Whitby
Posted by Mike Whitby to Magento (2012-03-08 13:04)