View Full Version : Help please - I broke the galleries link
atnaqueen
Mar-04-2009, 08:06 AM
I was working on our site and had the home page set with just a slideshow and the galleries page set with just the galleries, and then I went to fix the "About Joann" page and somehow broke the galleries link. Could someone take a look and see if there is something obvious? I've looked with my limited knowledge and can't seem to find it.
Thanks - I'm at work, but I'll check back at lunch.
J Allen
Mar-04-2009, 08:31 AM
Try adding this to your 'Bottom Javascript' box:
function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}
if (hasPath("galleries"))
YD.addClass(document.body, "galleries");
atnaqueen
Mar-04-2009, 02:36 PM
Try adding this to your 'Bottom Javascript' box:
function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}
if (hasPath("galleries"))
YD.addClass(document.body, "galleries");
Any other suggestions? I've looked at everything I can think of, but I'll try again when I get home tonight. Thanks!
jfriend
Mar-04-2009, 03:53 PM
I was working on our site and had the home page set with just a slideshow and the galleries page set with just the galleries, and then I went to fix the "About Joann" page and somehow broke the galleries link. Could someone take a look and see if there is something obvious? I've looked with my limited knowledge and can't seem to find it.
Thanks - I'm at work, but I'll check back at lunch.
You have at least one javascript error that is stopping the galleries code from working. After we fix the first one, there may be others that we can then see.
To fix the first error, add a missing closing single quote after Guestbook in this code in your bottom javascript:
function ModifyText ()
{
if (YD.hasClass(document.body, "gallery_7310359"))
{
var objElement = YD.get("comment")
if (objElement != null)
{
var str = new String(objElement.innerHTML);
str = str.replace(/\gallery/gi, 'Guestbook');
objElement.innerHTML = str;
}
}
}
Then, move this to from your bottom javascript to your top javascript:
function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}
Then, remove this from your bottom javascript (because you already have it in your footer):
if (hasPath("galleries"))
YD.addClass(document.body, "galleries");
atnaqueen
Mar-04-2009, 07:17 PM
:clapThat fixed it! Now I can move on down the list for the rest of the changes and hopefully not break anything else....
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.