Google Breadcrumb Links for osCommerce

By | October 30, 2010

Recently, a reader of clubosc, “Snowbird” brought up an interesting diversion based on one of my previous posts about changing the breadcrumb in osCommerce.

I did not know that Google sometimes shows breadcrumbs as part of the Search Engine Results Page (SERP), like so;

The breadcrumb part is the bottom line (in green). Note that the example is a result from Türkiye Google (Turkish Google), but can also be seen on the main google site as well as UK and many other Googles.

How to recreate this in osCommerce?

After some fiddling with code, I found that the simplest way is to use Googles examples as detailed here, the RDFa format is the easiest and involves changes to only 1 file!

Open up /includes/classes/breadcrumb.php and change the trail function as shown below;

Easy as that. I’ve also pasted the function here and if you want you can download the whole new breadcrumb class file here.

The changes really don’t do anything to your design, they only give Google the code it needs to determine that these links are to be used to produce a breadcrumb within your search listings.

Easy as 123. Of course, I give no guarantee that this change will do any good to your search results, please let me know if any of you change your breadcrumb and if Google then picks it up and displays as a breaded list of links in your SERP. Thanks.

13 thoughts on “Google Breadcrumb Links for osCommerce

  1. will langford

    I wonder if one could set that SPAN to display: none if their design isn’t visually appealing with breadcrumbs.

  2. Snowbird

    Above Gary’s one uses RDFa method. However DIV inline property needed for DIVs and SPANs to have them inline on a same row

    Alternatively Microdata method can be used (DIV)

    http://pastebin.com/5u6iDGKS

    Dont forget to add below CSS in your stylesheet.css

    #breadcrumbdiv { display:inline; }

  3. Gary Post author

    SN – nice work. Did you use your microdata or rdfa ?

    For everyopne else, we are talking about the breadcrumbs seen in Google Search Result;

    Whcih match those seen in the site;

  4. Xpajun

    So…

    I have a 4 month wait to see results…

    but is it just a gimmick or can it be of use?

  5. Gary Post author

    It can only help, would be my opinion. Else why would Google have it there in the first place (because we all know that Google owns the internet ;))

  6. Isa

    Gary, can one make breadcrumbs available for Google whilst hiding them on the site? ie: they are not visible on your pages but Google can still see them and list them?….hope I make sense lol

  7. Isa

    Thanks for the link Gary.
    ….after reading that article it seems fair to think that it would be unwise to try and hide my breadcrumbs, even if I don’t see how that could be perceived as “deceptive in intent”. Can’t Google understand the need of hiding breadcrumbs solely for design purposes?

  8. Anthony

    It looks like the included breadcrumb.php file is missing:

    } else {
    $trail_string .= $this->_trail[$i][‘title’];

    so if there is a breadcrumb with no link nothing is shown. For example, after you place an order the breadcrumbs aren’t there – just the separator since the breadcrumbs are no longer active links.

  9. Gary Post author

    Hi Rene, thanks for letting us know it worked for you.

Leave a Reply

Your email address will not be published.