PDA

View Full Version : Custom Banners


Fergus
Oct-09-2008, 05:06 PM
Hi there, I was wondering if someone could help me with something that I can't get to work:scratch . Can I set custom headers for different galleries rather than for different categories?
Cheers

jfriend
Oct-09-2008, 05:13 PM
Hi there, I was wondering if someone could help me with something that I can't get to work:scratch . Can I set custom headers for different galleries rather than for different categories?
Cheers

Yes, you can do it quite easily. First, set up your homepage banner. Then, after that in your CSS, you can add:

.gallery_xxyyzz #my_banner {
background: url(http://www.smugmug.com/photos/XXXXXX_YYYYY-O.gif) no-repeat;
}

where you replace the xxyyzz with the gallery number that you want it to affect and you replace the URL with the URL to the banner image you want to use in the gallery. You can have as many of these as you want. Each gallery page automatically has a class assigned to it that is gallery_xxyyzz and that allows this CSS rule to only target that specific gallery.

So, for a gallery that has an URL of http://jfriend.smugmug.com/gallery/5608869_vwzCG, you would use:

.gallery_5608869 #my_banner {
background: url(http://www.smugmug.com/photos/XXXXXX_YYYYY-O.gif) no-repeat;
}

Make sense? If, for some reason, you change the height or width of the banner over your home page banner, then you need to include the new height and width numbers in this gallery-specific declaration. If you keep it consistent, then you don't need to include it again as it will still be in force from the previous declaration. Make sure the gallery-specific declaration is after the general one.

Fergus
Oct-09-2008, 05:23 PM
That's brilliant thanks for your help:bow :D