View Full Version : Breadcrumb modification
camiller
Nov-30-2008, 02:30 PM
Hi,
I currently have a custom galleries page setup using a tutorial by Steve Allen. It only lists galleries, NO categories. The galleries page does not show a breadcrumb which is good. I would like for my gallery pages to show only the following in the breadcrumb
Example: Cynthia Miller>Galleries>Pets
There is some java in the customize section for showing the category in the breadcrumb, but I don't know how to modify it to do the above. Can someone please help.
Link to gallery page: http://cynthiamiller.smugmug.com/gallery/6698283_wLNjN
Link to flowers page:
http://cynthiamiller.smugmug.com/gallery/6695549_bGv2E#406488918_wizGr
Thank you.
jfriend
Nov-30-2008, 03:20 PM
Since I'm the one that wrote the code for your last breadcrumb customization, I guess I can take a stab at this one. So, let me see if understand what you want. Do you want the breadcrumb to always have these three pieces?
Left piece says "Cynthia Miller" and links to your homepage
Middle piece says "Galleries" and links to your galleries page
Right piece is the gallery name and has no need to link anywhere since that's where you already are.Is that what you want?
camiller
Nov-30-2008, 04:07 PM
Since I'm the one that wrote the code for your last breadcrumb customization, I guess I can take a stab at this one. So, let me see if understand what you want. Do you want the breadcrumb to always have these three pieces?
Left piece says "Cynthia Miller" and links to your homepage
Middle piece says "Galleries" and links to your galleries page
Right piece is the gallery name and has no need to link anywhere since that's where you already are.Is that what you want?
Hi John,
Yes.
I have a gallery called "Roses" in a category called "Flowers", when I am in the gallery looking at the roses I want the breadcrumb to reflect the following:
Cynthia Miller>Galleries>Roses
Not sure if you need this info, but I had to redo the gallery page and I titled it "Photos" under the category "My Galleries". Gallery link below.
http://cynthiamiller.smugmug.com/gallery/6698283_wLNjN
Thanks for your help.
jfriend
Nov-30-2008, 05:23 PM
Hi John,
Yes.
I have a gallery called "Roses" in a category called "Flowers", when I am in the gallery looking at the roses I want the breadcrumb to reflect the following:
Cynthia Miller>Galleries>Roses
Not sure if you need this info, but I had to redo the gallery page and I titled it "Photos" under the category "My Galleries". Gallery link below.
http://cynthiamiller.smugmug.com/gallery/6698283_wLNjN
Thanks for your help.
OK, replace your old code:
function AddLevelToBreadcrumb()
{
var str = this.innerHTML;
str = str.replace(/Cynthia Miller\<\/a>/, 'Cynthia Miller</a> > <a href="/gallery/6698283_wLNjN" class="nav">My Galleries</a>');
if (str != this.innerHTML)
{
this.innerHTML = str;
}
}
YE.onContentReady("breadCrumbTrail", AddLevelToBreadcrumb);
with this new code:
function AdjustBreadcrumb()
{
var str = this.innerHTML;
str = str.replace(/\n/g, " "); // str.replace won't match across line boundaries so remove line boundaries
// also IE6 has removed quotation marks on the innerHTML for attributes so you can't match on them
str = str.replace(/^.*?id=.?albumTitle.?>/, '<a href="http://cynthiamiller.smugmug.com" class="nav">Cynthia Miller</a> > <a href="http://cynthiamiller.smugmug.com/gallery/6698283_wLNjN" class="nav">Galleries</a> > <span class="title" id="albumTitle">');
if (str != this.innerHTML)
{
this.innerHTML = str;
}
}
YE.onContentReady("breadCrumbTrail", AdjustBreadcrumb);
and tell me if this looks like what you wanted.
camiller
Nov-30-2008, 05:33 PM
Perfect !!!!!
Thank you very much.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.