Page 1 of 1

Breadcrumbs with Products issue

Posted: Tue Jul 25, 2017 7:44 am
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.

Re: Breadcrumbs with Products issue

Posted: Tue Jul 25, 2017 8:39 am
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

Re: Breadcrumbs with Products issue

Posted: Tue Jul 25, 2017 9:11 am
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);
}
}

Re: Breadcrumbs with Products issue

Posted: Tue Jul 25, 2017 10:30 am
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!