Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Multiple CSS?

Quote Reply
Multiple CSS?
Can you create more than one CSS file? For example - for some category pages I want 3 columns, for others I may just want 1 column. The only way I see to do it right now is to set up different CSS files. I've never worked with CSS so all I was going to do was copy the original one, change what I want and then save it with a different name. Once I do that though, I can't figure out how to assign it to a template. Is there a better way of going about this?
Quote Reply
Re: [leeann] Multiple CSS? In reply to
There's several ways of doing this.

The simple way of doing it would be to edit the category template and add the css to it. Something like:
<%if category_id = 123 or category_id = 432%>
<%set category_cols = 1%>
<style type="text/css">
#category dl {
width: 100%;
The 'problem' with doing it this way is that you have to check for the category id in the template code. The set category_cols is there because you need to change it from whatever you have set in the globals, and lastly you have change the CSS to match the category_cols setting.

The more advanced (and a little more (in)flexible, depending on what you're doing) way would be to create a new template set and for each category you want 1 column for change the template set it uses (ie. set the Category Template). One possible issue with doing it this way is that the Category Template is inherited its sub categories.