How to add an item to magenta magenta

I want to display breadcrumbs while my own module is used on the magento interface for navigation, the site already has the corresponding batch code, which is used elsewhere according to the standard magento breadcrumbs.

What do I need to do in my module to indicate the current path of the pattern?

I would rather be able to do this programmatically, instead of writing something custom in the phpml breadcrumbs file

+6
source share
2 answers

you can call breadcrumbs as shown below in your custom block file in your _prepareLayout function.

 if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) { $breadcrumbs->addCrumb('home', array('label'=>$helper->__('Home'), 'title'=>$helper->__('Go to Home Page'), 'link'=>Mage::getBaseUrl())); $breadcrumbs->addCrumb('product_list', array('label'=>$helper->__('Brands'), 'title'=>$helper->__('Brands'), 'link'=>Mage::getUrl('brands'))); $breadcrumbs->addCrumb('product_detail', array('label'=>Mage::getModel('inic_brand/brand')->getBrandName($brand->getBrand(), Mage::app()->getStore()->getId()), 'title'=>$brand->getIdentifier())); } 

Hope this helps you.

+5
source

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

 <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...> 
+7
source

Source: https://habr.com/ru/post/953954/


All Articles