Magento Code Snippet – Do not Show Homepage in Breadcrumbs

A few days ago, I faced the problem that I did not want to have the „Home“ link in the Magento breadcrumbs navigation. To avoid this, we simply have to insert an additional if-condition to app/design/frontend/[yourtheme]/[yourtemplate]/template/page/html/breadcrumbs.phtml

The new breadcrumbs.phtml looks like this (line 06!):

<?php if($crumbs && is_array($crumbs)): ?>
 <?php foreach($crumbs as $_crumbName=>$_crumbInfo): ?>
 <?php // do not show homepage in breadcrumbs ?>
 <?php if($this->getUrl('') != $_crumbInfo['link']): ?>
 <?php if($_crumbInfo['link']): ?>
 <a href="<?php echo $_crumbInfo['link'] ?>" title="<?php echo $this->htmlEscape($_crumbInfo['title']) ?>"><?php echo $this->htmlEscape($_crumbInfo['label']) ?></a>
 <?php elseif($_crumbInfo['last']): ?>
 <strong><?php echo $this->htmlEscape($_crumbInfo['label']) ?></strong>
 <?php else: ?>
 <?php echo $this->htmlEscape($_crumbInfo['label']) ?>
 <?php endif; ?>
 <?php if(!$_crumbInfo['last']): ?>
 <span>/ </span>
 <?php endif; ?>
 <?php endif; ?>
 <?php endforeach; ?>
<?php endif; ?>

Hope this helps someone.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.