Open code/CORE/MAGE/CMS/block/page. php and find the followingCodeAdd the code behind Else. // Show breadcrumbs If (Mage: getstoreconfig ('web/default/show_cms_breadcrumbs ') & ($ Breadcrumbs = $ this-> getlayout ()-> getblock ('breadcrumbs ')) & ($ Page-> getidentifier ()! = Mage: getstoreconfig ('web/default/cms_home_page ')) & ($ Page-> getidentifier ()! = Mage: getstoreconfig ('web/default/cms_no_route '))){ $ Breadcrumbs-> addcrumb ('home', array ('label' => Mage: helper ('cm')->__ ('home '), 'title' => Mage: helper ('cms ')->__ ('go to home page'), 'link' => Mage: getbaseurl ())); $ Breadcrumbs-> addcrumb ('cms _ page', array ('label' => $ page-> gettitle (), 'title' => $ page-> gettitle ())); } Else {$ breadcrumbs-> addcrumb ('home', array ('label' => Mage: helper ('cm')->__ ('home '), 'title' => Mage: helper ('cms ')->__ ('go to home page'), 'link' => Mage: getbaseurl ())); $ Breadcrumbs-> addcrumb ('cms _ page', array ('label' => $ page-> gettitle (), 'title' => $ page-> gettitle ())); } If you want to display breadcrumbs on a page without breadcrumbs by default, open breadcrumbs. phtml and add the following code:
<? PHP /** * * Custom breadcrumbs * By magentoex.com * * Adds URL breadcrumbs for pages that do not have breadcrumbs by default * */?> <? PHP if (is_null ($ crumbs):?> <? PHP /** * Note * On Some servers use-> getserver ('path _ info ') * And on some-> getserver ('orig _ path_info ') */$ URLRequest = Mage: APP ()-> getfrontcontroller ()-> getrequest (); $ Urlpart = $ URLRequest-> getserver ('orig _ path_info '); If (is_null ($ urlpart )) { $ Urlpart = $ URLRequest-> getserver ('path _ info '); } $ Urlpart = substr ($ urlpart, 1 ); $ Currenturl = $ this-> geturl ($ urlpart); $ controllername = Mage: APP ()-> getfrontcontroller ()-> getrequest ()-> getcontrollername (); $ Controllername = ucfirst ($ controllername); $ controllername = str_replace ("/", "", $ urlpart ); $ Controllername = str_replace ("_", "", $ controllername ); $ Controllername = str_replace ("-", "", $ controllername ); $ Controllername = ucfirst ($ controllername);?> <Strong class = "no-display"> <? PHP echo $ this->__ ("you're currently on:")?> </Strong> <Ul class = "Breadcrumbs"> <Li class = "home"> <A Title = "<? PHP echo $ this->__ ('go to home page')?> "Href =" <? PHP echo $ this-> geturl ()?> "> <? PHP echo $ this->__ ('home')?> </A> </LI> <Li>/</LI> <Li class = "<? PHP echo strtolower ($ controllername)?> "> <Strong> <? PHP echo $ this->__ ($ controllername)?> </Strong> </LI> </Ul> <? PHP endif;/* end of M breadcrumbs */?>
|