Home > Magento > Improved Magento Breadcrumbs

Improved Magento Breadcrumbs

Posted on: 28th Jan 2010 By: Adam Moss 3 Comments

A simple little SEO tip for Magento developers to take on board is the editing of one of the fundamental parts of any e-commerce website – the breadcrumb trail. By default the breadcrumb trail places the divider (a forward slash) into the list tags, meaning between each worthwhile list element is an unhelpful list element. This simple hack removes the wasted list tags and places the divider into the tags that contain the breadcrumb link.

Read below to see how to do it:

This is the appearance of the important part of the breadcrumb code before:

<?php endif; ?>
</li>
<?php if(!$_crumbInfo['last']): ?>
<li> / </li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>

You simply need to change the code towards the bottom of the file, at the end of the first endif statement:

<?php endif; ?>
<?php if(!$_crumbInfo['last']): ?>
/
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>

Your links will now change from this:

<ul>
<li><a href="/">Link 1</a></li>
<li> / </li>
<li><a href="/">Link 2</a></li>
<li> / </li>
<li><strong>Page 1</strong></li>
</ul>

To this:

<ul>
<li><a href="/">Link 1</a> / </li>
<li><a href="/">Link 2</a> / </li>
<li><strong>Page 1</strong></li>
</ul>

3 Responses to “ Improved Magento Breadcrumbs ”

  1. Imischa
    #1 | 6th May 2010

    Very handy, thank you! One question, for which version of magento is this for or doesn’t mater?!

  2. mouth ulcers treatment
    #2 | 3rd May 2011

    I was wondering if it is possible to have breadcrum showing a hierarchie for the cms pages ?

  3. Adam Moss
    #3 | 4th May 2011

    Magento CMS pages don’t typically have folders / subfolders so there’s no real hierarchy. The breadcrumbs should still show like this though:

    Home / “Pagename”

Post A Comment

Your comments:
Enclose code snippets within the appropriate tags: [php][/php]   [js][/js]   [xml][/xml]   [css][/css]   [html][/html]
E.g: [php]<?php echo "hello world"; ?>[/php]

Search Blog

Archives

For the record...

Views & opinions in this blog are those of the individual and do not necessarily reflect those of E-commerce Web Design or the Creare Group.