Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add an item to magento breadcrumbs

I want to display breadcrumbs while a use navigates my own module on the frontend of magento, the site already has the appropriate breadcrumb code in place thats used elsewhere as per standard magento breadcrumbs.

What do I need to do in my module to specify the current breadcrumb path?

I'd prefer to be able to do this programmatically rather than having to write something custom in the breadcrumbs phtml file

like image 459
Matthew Avatar asked Sep 16 '13 23:09

Matthew


1 Answers

You can call breadcrumbs also from xml in any custom modules layout.

<index_index...>   
 <reference name="breadcrumbs">
            <action method="addCrumb">
                <crumbName>Home</crumbName>
                <crumbInfo>
                    <label>Home</label>
                    <title>Home</title>
                    <link>/</link>
                </crumbInfo>
            </action>
            <action method="addCrumb">
                <crumbName>Contacts</crumbName>
                <crumbInfo>
                    <label>Custom Page</label>
                    <title>Custom Page</title>
                </crumbInfo>
            </action>
        </reference>
</index_index...>
like image 190
Kārlis Millers Avatar answered Sep 21 '22 01:09

Kārlis Millers