| magento添加breadcrumb到指定页面, 1、在对应的layout上添加一个breadcurmb的block
2、在对应module下的blcok页面的_prepareLayout()方法中添加如下信息
if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) {
$breadcrumbs->addCrumb('home', array('label'=>Mage::helper('cms')->__('home'), 'title'=>Mage::helper('cms')->__('Go to Home Page'), 'link'=>Mage::getBaseUrl()));
$breadcrumbs->addCrumb('person center', array('label' => $this->__('Personal Center'), 'title' => 'personal center', 'link'=>Mage::getUrl('customer/account')));
$breadcrumbs->addCrumb('my order', array('label' =>$this->__('My Order'), 'title' => 'my order'));
}
注释:lable就是你要显示的文字(首页、个人中心、我的订单等) 3、在phtml模板中获取breadcrumb
<?php echo $this->getChildHtml('breadcrumbs') ?>
实现的效果图
|





ecshop仿妙乐乐母婴用品商
人气:665
ecshop仿爱之谷成人用品商
人气:1491
ecshop仿1mall网上超市整站免
人气:7963
ecshop仿本来生活网2014加团
人气:2274
空包网刷快递单号自动发
人气:3467
一元云购夺宝程序源码带
人气:2342