Page 1 of 1

Category images or banners

Posted: Wed Mar 10, 2010 12:03 am
by hdiaz36
I've been trying to get a different banner for each individual category, but I cannot seem to get this to work properly.

If I go to a category and I enter an image, it doesn't change the banner, but will simply add another image below the banner. To make thing worse is that the category image will fall behind any images at the top of an entry.

Is there an easy way to have a different banner for each category?

If I remember correctly, I previously modified the index.tpl of my theme and that is how I got a new banner, but what I'm actually trying to achieve is a new banner for each category.

Hope everything I've written makes sense.

I'll attach some screen shots for the sake of clarity.

In this I have already changed the banner.
Image


Here I have tried to add an image for the category, but the end result is nowhere near what I desired. :(
Image

Re: Category images or banners

Posted: Wed Mar 10, 2010 11:20 am
by yellowled
hdiaz36 wrote:If I go to a category and I enter an image, it doesn't change the banner
That's meant to be used for a category icon actually. Something to indicate the category of an entry visually, usually within the entry.
hdiaz36 wrote:Is there an easy way to have a different banner for each category?
Phew, define "easy".

We have the event plugin "Properties/Templates of categories" which makes it possible to assign different templates to a category. You could assign the same template to each category, but with a different banner. This would be much easier if your template supports a header image from the media db, which I take it is not the case right now?

My personal experience with this plugin is that it is kind of complicated to use and prone to error. Everyone's mileage may vary.

You could also hack your template to use different banner images for various categories, but that is kind of difficult to implement, I guess.

YL

Re: Category images or banners

Posted: Wed Mar 10, 2010 1:49 pm
by garvinhicking
Hi!

Maybe the easiest way is inside your index.tpl:

Code: Select all

<div class="serendipity_banner{$category}">
on the banner, and then use CSS to create a class for serendipity_banner1, serendipity_banner4 etc. (the number corresponds to the number of your category).

HTH,
Garvin

Re: Category images or banners

Posted: Wed Mar 10, 2010 4:19 pm
by Don Chambers
Hey, that's a pretty cleaver idea Garvin! :wink: