Breadcrumbs with Products issue

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Mich-adg
Forum Members
Forum Members
Posts: 200
Joined: Sat Aug 02, 2008 9:08 pm

Breadcrumbs with Products issue

Post by Mich-adg »

Hi,

i'm trying to add breadcrumbs in the products templates with the help of this tutorial:
https://www.cmscanbesimple.org/blog/bre ... cts-module

I got one bug: when i start from root hierarchy, go down in sub hierarchy, go to a product detail and then want to go on previous level, i got no more hierarchy summaries showing (but coming from detail to root =level-2 is ok !).
The url link in breadcrumb to come to H-1 (previous hierarchy) is like this : "https://www.mysite.com/products/hierarc ... yname.html"
If i change the url and add by in "/byhierachy/" it works !!

So how can i change the url for this H-1 link only? (by adding "by" before hierarchy).
Thanks for any help!


I use Products 2.26.9 and cms 2.1.6.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Breadcrumbs with Products issue

Post by Rolf »

I haven't updated that article for a while, so the method can be changed somehow because of module updates... Back then I made the article just because I wanted to know if and how it worked, but I don't have a website that uses it so can't tell if it still works for 100%.

Maybe I will dive into it some day during the holidays...

Note that this method can also be usefull here:
https://www.cmscanbesimple.org/blog/bre ... ews-module
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Mich-adg
Forum Members
Forum Members
Posts: 200
Joined: Sat Aug 02, 2008 9:08 pm

Re: Breadcrumbs with Products issue

Post by Mich-adg »

Thanks Rolf for the reply and your good blog, i'm gonna pay you a coffee today ! ;)

For the moment i use this tip to correct the url with jQuery in Page Template (not the best solution but works) :

if ( $('.breadcrumbs').length ) {
if ( $(".breadcrumbs > a").length > 1) {
var myurl = $('.breadcrumbs a:nth-last-child(1)').attr('href');
myurl = myurl.replace('hierarchy', 'byhierarchy' );
$('.breadcrumbs a:nth-last-child(1)').attr('href', myurl);
}
}
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Breadcrumbs with Products issue

Post by Rolf »

Mich-adg wrote:Thanks Rolf for the reply and your good blog, i'm gonna pay you a coffee today ! ;)
Wow, thanks! Much appreciated!
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Modules/Add-Ons”