My friend Paul recently asked about how to have images in the usual osCommerce breadcrumb…I answered it as a comment to a very old post in this blog, but thought it deserved it’s own post. So…
Step 1. Make yourself a “home” graphic and an “arrow” graphic, save them into the usual osCommerce images directory. I called mine “home.gif” and “arrow.gif”.
Step 2. Open up /includes/header.php and find this:
[php]$breadcrumb->trail(‘ » ‘);[/php]
Change it to this:
[php]$breadcrumb->trail(tep_image(DIR_WS_IMAGES . ‘arrow.gif’, ”, ”, ”, ‘align=”absmiddle”‘));[/php]
This is telling osCommerce to use the arrow image. The parameter align=”absmiddle” is not great, but does OK for this demonstration. Better would be to add a class and then vertical align the class (I’ll cover that another time). align=”absmiddle” lines up the image with the text.
Save the changes and upload the file.
Step 3. Open up /includes/application_top.php and find this:
[php]$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);[/php]
Change it to this:
[php]$breadcrumb->add(tep_image(DIR_WS_IMAGES . ‘home.gif’, ”, ”, ”, ‘align=”absmiddle”‘) , HTTP_SERVER);[/php]
Save the changes and upload the file.
Refresh your osCommerce, and you’ll get a breadcrumb that looks something like this;
Mine is ugly in the extreme, but if you take your time in creating nice images, and then play with the stylesheet, you can come up with all sorts of great idea. Here is what Paul made;
Which I think looks great!
What can you come up with for the breadcrumb in your osCommerce site? More ideas.
Gary, do you know how Google is sensitive reading breadcrumbs when includes images in it? I mean how this effects Google new breadcrumb links display described in http://www.searchcowboys.com/google/1271
SN – I don’t know. I suspect the google breadcrumb would be made from the products URL, though cannot say for sure. Do you have any live examples in google search results to look at?
Yeah, try this direct link
http://www.google.com.tr/search?q=akakce+phaser+3140&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:tr:official&client=firefox-a
Actually Google didn’t launched publicly this breadcrumbed link display in search results. They gave this opportunity to some selected hi-ranked shops, blogs (Amazon, etc)
I think Google requires special breadcrumb format. I did it in my one of the shops made with osC as described @ http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=185417 but didn’t work yet. Finger crossed.
Interesting, thanks SN. Is it worth it? I have never noticed a breadcrumb in any search I’ve made…
Could be worth doing though. Would be an easy change in the breadcrumb class file;
http://pastebin.com/F0tdDaGD
And in the /includes/header.php;
http://pastebin.com/H5MymPfX
That should do it, but I have not tested the code change,so it might not work 😉
SN; http://www.clubosc.com/google-breadcrumb-links-for-osc.html