且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将项目添加到magento面包屑

更新时间:2023-11-29 22:42:04

您可以在_prepareLayout函数的自定义块文件中调用如下所示的面包屑.

you can call breadcrumbs like 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 will be sure help to you.