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
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