PDA

View Full Version : Breacrumbs not displaying 'Galleries'


Mog
Jul-07-2007, 02:45 AM
Morning All,

I did post this amongst another thread but it appears to have got lost down the line.

How can I get my Breadcrumbs to display 'Galleries' I only get the option to click on 'Mog' that takes the user back to my homepage/slideshow. I would like to give them the option to just go back to my gallery page ( as per Andys website )

Andys:

http://Mog.smugmug.com/photos/170362866-L.jpg

How mine is:

http://Mog.smugmug.com/photos/170362868-L.jpg

Help ??

As always, any help most appreciated.....

Mike Lane
Jul-07-2007, 03:07 AM
It looks to me like you're using the gallery page hack. Andy has actually used a category he named galleries which is why you see this in his breadcrumb.

I'm not sure if this is something that can be hacked or not. I do know that if it can it is above my head.

You may want to post a request for a hack in the hacks room or to the thread where you found the gallery page hack in the first place.

oxy8384
Jul-07-2007, 12:43 PM
try adding this code to your footer section and let me know if I came close...
(change all occurences of 'skript', below, with 'script'):

<skript type="text/javascript" language="Javascript">
var bc = document.getElementById('breadcrumb');
if (bc) {
bc.innerHTML = bc.innerHTML.replace('&nbsp;&gt;&nbsp;', '&nbsp;&gt;&nbsp;<a href="http://mog.smugmug.com/galleries">Galleries</a>&nbsp;&gt;&nbsp;');
}
</skript>
Bill

Mog
Jul-07-2007, 02:12 PM
try adding this code to your footer section and let me know if I came close...

Bill

Bill,

That's incredibly close, I get the 'Galleries' appearing as a breadcrumb, however it almost instantly throws up the error message below, and then loads a 'Page cannot be displayed window'

http://Mog.smugmug.com/photos/170507901-L.jpg

Appreciate the help...

Mog
Jul-07-2007, 02:17 PM
Bill,

That's incredibly close, I get the 'Galleries' appearing as a breadcrumb, however it almost instantly throws up the error message below, and then loads a 'Page cannot be displayed window'

Appreciate the help...

Just to add, it 99% works in Firefox. Galleries appears as a breadcrumb and links back fine but it is underlined all the time.. !

oxy8384
Jul-07-2007, 04:15 PM
Just to add, it 99% works in Firefox. Galleries appears as a breadcrumb and links back fine but it is underlined all the time.. !
Simon,
Any chance we can try this on a single (low-popularity) gallery so we can get that last couple percent? I've got a few hours, now, and we could do this by dropping the following code into your footer (this will only apply my change to the gallery for your new Rockhopper - I actually have the 1987 model!)
<skript type="text/javascript" language="Javascript">
var bc = document.getElementById('breadcrumb');
if (YD.hasClass(document.body, 'gallery_2678191')) {
bc.innerHTML = bc.innerHTML.replace('&nbsp;&gt;&nbsp;', '&nbsp;&gt;&nbsp;<a href="http://mog.smugmug.com/galleries">Galleries</a>&nbsp;&gt;&nbsp;');
}
</skript>You can change the gallery number to whatever you want, but ideally, I'd like to use a gallery with a category and a subcatrgory, just to test the worst case.

Bill

devbobo
Jul-07-2007, 04:29 PM
Bill,

That's incredibly close, I get the 'Galleries' appearing as a breadcrumb, however it almost instantly throws up the error message below, and then loads a 'Page cannot be displayed window'

http://Mog.smugmug.com/photos/170507901-L.jpg

Appreciate the help...

Mog,

Try this (put it in your javascript section)...


YE.onContentReady('breadcrumb', function() {var oItems = this.getElementsByTagName('a'); if (oItems[0]) oItems[0].href="galleries"});



Cheers,

David

Mog
Jul-08-2007, 01:02 AM
Bill,

That still didn't work I'm afraid. Still fired up that IE error message.


David,

That's close. It working on gallery categories, however when I go into a gallery the link is removed.

Thanks both for your time and help, much appreciated..

devbobo
Jul-08-2007, 03:22 AM
David,

That's close. It working on gallery categories, however when I go into a gallery the link is removed.

Thanks both for your time and help, much appreciated..

ok try this...


YE.onContentReady('breadcrumb', function() {
for (var i in this.childNodes) {
if (this.childNodes[i].tagName == "A") {
this.childNodes[i].href="/galleries";
break;
}
}
});

Mog
Jul-08-2007, 03:47 AM
ok try this...


YE.onContentReady('breadcrumb', function() {
for (var i in this.childNodes) {
if (this.childNodes[i].tagName == "A") {
this.childNodes[i].href="/galleries";
break;
}
}
});



David,

Success, that works a treat :bow :clap

Many thanks for your help, much appreciated

oxy8384
Jul-08-2007, 07:35 AM
Simon,
I thought you wanted to insert a Galleries link between 'Mog' (a link to your home page) and the Category title. Oh well. Your satisfaction is all that counts!

David,
Can you explain how this works? Looking at it, I would expect it to just replace the href on the 'Mog' part of the breadcrumb, but it seems to be changing the text from 'Mog' to 'Galleries', as well, which mystifies me...:scratch

Thanks,

Bill

Mog
Jul-08-2007, 07:56 AM
Simon,
I thought you wanted to insert a Galleries link between 'Mog' (a link to your home page) and the Category title. Oh well. Your satisfaction is all that counts!

David,
Can you explain how this works? Looking at it, I would expect it to just replace the href on the 'Mog' part of the breadcrumb, but it seems to be changing the text from 'Mog' to 'Galleries', as well, which mystifies me...:scratch

Thanks,

Bill

Hi Bill,

I have changed the text from Mog to Galleries using the Javascript below:

addEvent(window, "load", ModifyText);
function ModifyText () {
var objElement = document.getElementById("breadcrumb")
if (objElement != null) {
var str = new String(objElement.innerHTML);
str = str.replace('>Mog<', '>Galleries<')
objElement.innerHTML = str;
}
}

oxy8384
Jul-08-2007, 02:31 PM
It's not magic, after all!:thumb