Basically, i want to replace all "Home" breadcrumb links, with an image of my choice.
rather than modifying the header.tpl file and removing all references to the home breadcrumb link from every controller file, id like to globally replace home with an image.
anyone have any ideas?
its not the breadcrumb background i want to style though, i want to replace the home link with an image.
the home link is only visible when you navigate away from the home page. In each controller file you have the code to display the home link breadcrumb before the current path breadcrumb link. Rather than edit every controller file, i wanted to know if there was a way to replace the home link with an image, like an icon of a house
the home link is only visible when you navigate away from the home page. In each controller file you have the code to display the home link breadcrumb before the current path breadcrumb link. Rather than edit every controller file, i wanted to know if there was a way to replace the home link with an image, like an icon of a house

Once again with CSS and some tricky JS you can exchange text with images. See this example:
With JS (I prefer jQuery and also is bundled in OpenCart) you can add or remove CSS properties so you can get the Home text and replace with <img /> tags. Sounds complex but isn't. Just take a look at jQuery Docs and try to do this example.
Cheers and lucky
Code: Select all
<a href="index.php?route=home"><span>Home</span></a>
Cheers and lucky
ok, i managed to do it, slightly easier than using a span class and defining it in the stylesheet
catalog/view/theme/yourtheme/template/common/header.tpl
find
change to
Probably abit messy, but it works 
catalog/view/theme/yourtheme/template/common/header.tpl
find
Code: Select all
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php echo $breadcrumb['separator']; ?><a href="<?php echo str_replace('&', '&', $breadcrumb['href']); ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
Code: Select all
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php if (($breadcrumb['href']) && ($breadcrumb['href'] == 'http://www.yoursite.com/index.php?route=common/home')) { ?>
<a href="<?php echo str_replace('&', '&', $breadcrumb['href']); ?>"><img src="catalog/view/theme/yourtheme/image/yourimage.png"></a>
<?php } else { ?>
<?php echo $breadcrumb['separator']; ?><a href="<?php echo str_replace('&', '&', $breadcrumb['href']); ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
<?php } ?>

great idea but it's not working for me. is this version specific code? I'm on 1.4.9.5. Thanks!
Who is online
Users browsing this forum: Majestic-12 [Bot] and 78 guests