dtdvbf37193 2013-09-16 23:46
浏览 28
已采纳

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

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

  • 写回答

2条回答 默认 最新

  • dongzhuoxie1244 2013-09-17 04:03
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)