Breadcrumb mod partly working
jecwobble
Registered Users Posts: 17 Big grins
I modified my homepage to have a slideshow separate from my galleries list. However I didn't like how the root of the breadcrumb links pointed to the slideshow (/) instead of galleries (/galleries). So to alter my breadcrumb links I wrote the following JS borrowing from the advanced tip to change "gallery comments" to "Guestbook comments" on my Guestbook gallery:
It works as desired on my gallery pages but only partially works on my category pages. The first str.replace doesn't change the HREF, but the second str.replace does change the link text. Has anybody tried to modify their breadcrumb links, and if so, how did you do it?
// Change root of breadcrumb trail function ModBreadCrumb () { var objElement = YD.get("breadCrumbTrail") if (objElement != null) { var str = new String(objElement.innerHTML); str = str.replace(/photojec.com" class/gi, 'photojec.com/galleries" class'); str = str.replace(/John Christiansen/gi, 'JEC Photography'); objElement.innerHTML = str; } } YE.onAvailable("breadCrumbTrail", ModBreadCrumb);
It works as desired on my gallery pages but only partially works on my category pages. The first str.replace doesn't change the HREF, but the second str.replace does change the link text. Has anybody tried to modify their breadcrumb links, and if so, how did you do it?
0
Comments
Nevermind. I figured it out. The category pages have the root breadcrumb with a trailing forward slash (/) while the galleries don't. The following JS works fully on category pages now (note bold red addition):
Best regards,
Yangchen
www.linyangchen.com