Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Header Image for Main Categories

Quote Reply
Header Image for Main Categories
Hi

I was wondering whether anyone knew how to get an image that is displayed for a category to be also displayed for all subcategories.

I created a field in the category .def called Category_Image

Then I use this to display the image :
<%if Category_Image%>
<img src="<%build_images_url%>/<%Category_Image%>" border=0 />
<%endif%>

which doesn't provide the appropriate path but i just uploaded the same file to where it's looking for it (Can't be bothered to figure out why paths for uploaded files get some weird and wonderful path when called through LinksSQL something to do with the fact that its hashed I think and it works like this anyway)

However I would like to get the category image to display for category "1" for example and all categories that are subcategories of "1" but at the moment it will only display for category "1" which is understandable from the code.

Does anybody know how I can get this to work ?

Thanks, John

Edit :

I have got it to work using this :
<%if Category_Image%>
<img src="<%build_images_url%>/<%Category_Image%>" border=0 />
<%elsif FatherID eq '1'%>
<img src="<%build_images_url%>/categoryheader_1.jpg" border=0 />
<%elsif FatherID eq '2'%>
<img src="<%build_images_url%>/categoryheader_2.jpg" border=0 />
<%endif%>

I only have 9 main categories but if anyone has a cleaner way of doing it ???

Thanks
Significant Media

Last edited by:

Jag: Nov 19, 2004, 7:53 PM
Subject Author Views Date
Thread Header Image for Main Categories Jag 4904 Nov 19, 2004, 7:46 PM
Thread Re: [Jag] Header Image for Main Categories
afinlr 4752 Nov 20, 2004, 9:44 AM
Thread Re: [afinlr] Header Image for Main Categories
Jag 4767 Nov 20, 2004, 10:04 AM
Thread Re: [Jag] Header Image for Main Categories
afinlr 4740 Nov 20, 2004, 10:15 AM
Thread Re: [afinlr] Header Image for Main Categories
Jag 4750 Nov 20, 2004, 10:21 AM
Thread Re: [Jag] Header Image for Main Categories
afinlr 4749 Nov 20, 2004, 12:00 PM
Thread Re: [afinlr] Header Image for Main Categories
Jag 4733 Nov 20, 2004, 8:45 PM
Thread Re: [Jag] Header Image for Main Categories
afinlr 4715 Nov 21, 2004, 7:20 AM
Thread Re: [afinlr] Header Image for Main Categories
Jag 4723 Nov 21, 2004, 11:18 PM
Thread Re: [Jag] Header Image for Main Categories
afinlr 4714 Nov 22, 2004, 3:40 AM
Thread Re: [afinlr] Header Image for Main Categories
Jag 4690 Nov 23, 2004, 2:37 PM
Thread Re: [Jag] Header Image for Main Categories
afinlr 4730 Nov 23, 2004, 2:55 PM
Post Re: [afinlr] Header Image for Main Categories
Jag 4700 Nov 23, 2004, 3:06 PM
Post Re: [afinlr] Header Image for Main Categories
Jag 4680 Nov 24, 2004, 2:24 AM
Thread Re: [afinlr] Header Image for Main Categories
Jag 4597 Jul 30, 2005, 6:02 PM
Thread Re: [Jag] Header Image for Main Categories
afinlr 4588 Jul 31, 2005, 1:00 PM
Post Re: [afinlr] Header Image for Main Categories
Jag 4575 Aug 1, 2005, 8:04 AM