View Full Version : Help with BreadCrumb Hack
iklimon
Oct-09-2008, 10:14 AM
I am trying to change out my nickname and have the changed word lead to a different URL. Right now I have the change to the destination working, but I cannot for the life of me get the name (klimonphoto) changed. Any help?
:dunno
/*=======================*/
/*== CHANGE BREADCRUMB ==*/
/*=======================*/
addEvent(window, "load", ModifyText);
function ModifyText () {
var objElement = document.getElementById("breadCrumbTrail")
if (objElement != null) {
var str = new String(objElement.innerHTML);
str = str.replace('klimonphoto','Photos');
objElement.innerHTML = str;
}
}
function ModifyText () {
var objElement = document.getElementById("breadCrumb")
if (objElement != null) {
var str = new String(objElement.innerHTML);
str = str.replace('klimonphoto','Photos');
objElement.innerHTML = str;
}
}
YE.onContentReady('breadCrumbTrail', function() {
for (var i in this.childNodes) {
if (this.childNodes[i].tagName == "A") {
this.childNodes[i].href="/galleries";
break;
}
}
});
YE.onContentReady('breadcrumb', function() {
for (var i in this.childNodes) {
if (this.childNodes[i].tagName == "A") {
this.childNodes[i].href="/galleries";
break;
}
}
});
iklimon
Oct-09-2008, 10:25 AM
I am trying to change out my nickname and have the changed word lead to a different URL. Right now I have the change to the destination working, but I cannot for the life of me get the name (klimonphoto) changed. Any help?
I've also tried this code:
/*=======================*/
/*== CHANGE BREADCRUMB ==*/
/*=======================*/
YE.onContentReady('breadCrumbTrail', function() {this.innerHTML =
this.innerHTML.replace('klimonphoto','Photos')});
YE.onContentReady('breadCrumbTrail', function() {
for (var i in this.childNodes) {
if (this.childNodes[i].tagName == "A") {
this.childNodes[i].href="/galleries";
break;
}
}
});
YE.onContentReady('breadcrumb', function() {
for (var i in this.childNodes) {
if (this.childNodes[i].tagName == "A") {
this.childNodes[i].href="/galleries";
break;
}
}
});
To no avail...I just can't change that "klimonphoto" on my breadcrumb... :scratch
Allen
Oct-09-2008, 10:30 AM
I've also tried this code:
/*=======================*/
/*== CHANGE BREADCRUMB ==*/
/*=======================*/
YE.onContentReady('breadCrumbTrail', function() {this.innerHTML =
this.innerHTML.replace('klimonphoto','Photos')});
YE.onContentReady('breadCrumbTrail', function() {
for (var i in this.childNodes) {
if (this.childNodes[i].tagName == "A") {
this.childNodes[i].href="/galleries";
break;
}
}
});
YE.onContentReady('breadcrumb', function() {
for (var i in this.childNodes) {
if (this.childNodes[i].tagName == "A") {
this.childNodes[i].href="/galleries";
break;
}
}
});
To no avail...I just can't change that "klimonphoto" on my breadcrumb... :scratch
I know that this will work as it is. Maybe all the other stuff is stopping it.
YE.onContentReady('breadCrumbTrail', function() {this.innerHTML =
this.innerHTML.replace('klimonphoto', 'Photos')});
iklimon
Oct-09-2008, 10:32 AM
I know that this will work as it is. Maybe all the other stuff is stopping it.
YE.onContentReady('breadCrumbTrail', function() {this.innerHTML =
this.innerHTML.replace('klimonphoto', 'Photos')});
I just removed everything else and just did this...still no go...there must be something else interfering?
Allen
Oct-09-2008, 10:37 AM
I just removed everything else and just did this...still no go...there must be something else interfering?
Like I said, that works, had just used it on my site. Must be something else in
your js b0rking it. Copy all your js to a text file and only put that in and see if
it works.
Put it in alone without the comment.
iklimon
Oct-09-2008, 10:39 AM
Like I said, that works, had just used it on my site. Must be something else in
your js b0rking it. Copy all your js to a text file and only put that in and see if
it works.
Put it in alone without the comment.
I just did that. It works on any gallery page:
http://photos.klimon.com/gallery/5169873_hpNy7#319626906_E2JE6
But not on the Sub-Categories page:
http://photos.klimon.com/Baseball/566991
or on the Categories page:
http://photos.klimon.com/Baseball
Weird... :scratch
Allen
Oct-09-2008, 10:42 AM
I just did that. It works on any gallery page:
http://photos.klimon.com/gallery/5169873_hpNy7#319626906_E2JE6
But not on the Sub-Categories page:
http://photos.klimon.com/Baseball/566991
or on the Categories page:
http://photos.klimon.com/Baseball
Weird... :scratch
Add this also
YE.onContentReady('breadcrumb', function() {this.innerHTML =
this.innerHTML.replace('klimonphoto', 'Photos')});
Looks like breadCrumbTrail is only on gallery pages. breadcrumb is used on other page.
iklimon
Oct-09-2008, 10:45 AM
That did the trick. I guess I misread the other post about changed breadCrumb to breadCrumbTrail... :clap
Once again, thanks for your help!
Here is the final working code to change the breadcrumb link and nickname:
/*=======================*/
/*== CHANGE BREADCRUMB ==*/
/*=======================*/
YE.onContentReady('breadCrumbTrail', function() {this.innerHTML =
this.innerHTML.replace('klimonphoto','Photos')});
YE.onContentReady('breadcrumb', function() {this.innerHTML =
this.innerHTML.replace('klimonphoto', 'Photos')});
YE.onContentReady('breadCrumbTrail', function() {
for (var i in this.childNodes) {
if (this.childNodes[i].tagName == "A") {
this.childNodes[i].href="/galleries";
break;
}
}
});
YE.onContentReady('breadcrumb', function() {
for (var i in this.childNodes) {
if (this.childNodes[i].tagName == "A") {
this.childNodes[i].href="/galleries";
break;
}
}
});
:barb
Allen
Oct-09-2008, 10:51 AM
... html on the different pages.
category
<div id="category" class="category category_Baseball tempClass bodyColor_Black">
<div id="breadcrumb" class="nav">
<div id="altViews"/>
<a class="nav" href="/galleries">Photos</a>
>
<span class="title">Baseball</span>
<div class="spacer"/></div>
...
sub-cat
<div id="category" class="category category_Baseball tempClass subcategory subcategory_Anaheim_PONY_-_2008_Shetland_All-Star_Tournament bodyColor_Black">
<div id="breadcrumb" class="nav">
<div id="altViews"/>
<a class="nav" href="/galleries">Photos</a>
>
<a class="nav" href="/Baseball">Baseball</a>
>
<span class="title">Anaheim PONY - 2008 Shetland All-Star Tournament</span>
<div class="spacer"/></div>
...
gallery
<div id="smugmug" class="smugmug smugmug_ajax galleryPage gallery_5288286 tempClass category_Baseball subcategory_Anaheim_PONY_-_2007_Shetland_All-Star_Tournament bodyColor_Black">
<div id="breadcrumb" class="nav">
<div id="altViews" class="nav"></div>
<div id="breadCrumbTrail">
<a class="nav" href="http://photos.klimon.com">klimonphoto</a>
>
<a class="nav" href="http://photos.klimon.com/Baseball">Baseball</a>
>
<a class="nav" href="http://photos.klimon.com/Baseball/566989">Anaheim PONY - 2007 Shetland All-Star Tournament</a>
>
<span id="albumTitle" class="title">Anaheim A (2nd Place)</span>
</div>
<div class="spacer"/></div>
...
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.