MyBB Community Forums

Full Version: Alternating Colors in Repeating Templates
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm wondering whether its possible that you can make alternating colors in templates that repeat, like the forum bit.

I want to make a theme where each forum category has an alternating class. Is that possible?
You could use the category id in a CSS class.
You could add a class like "cat" or something in the forumbit and then use jQuery :odd or :even to change the styling.

That's the way I would do it but I don't know much Toungue
(2010-09-01, 03:48 PM)Scoutie44 Wrote: [ -> ]You could use the category id in a CSS class.
I can't do that because category IDs are assigned based on creation, not order or anything. Deleting a category or reordering them would mess it up.


(2010-09-01, 04:20 PM)Joshee Wrote: [ -> ]You could add a class like "cat" or something in the forumbit and then use jQuery :odd or :even to change the styling.

That's the way I would do it but I don't know much Toungue
That's interesting, I'll look into that Smile
(2010-09-01, 04:39 PM)Zash Wrote: [ -> ]I can't do that because category IDs are assigned based on creation, not order or anything. Deleting a category or reordering them would mess it up.

Big cheesy hairy deal, so you have to edit a handful of CSS classes. It's not like you'll be moving/adding categories on a daily basis... Toungue
(2010-09-01, 05:46 PM)Scoutie44 Wrote: [ -> ]
(2010-09-01, 04:39 PM)Zash Wrote: [ -> ]I can't do that because category IDs are assigned based on creation, not order or anything. Deleting a category or reordering them would mess it up.

Big cheesy hairy deal, so you have to edit a handful of CSS classes. It's not like you'll be moving/adding categories on a daily basis... Toungue

What if it's a theme that's being released? The user would need to know CSS and know what to edit/what to add to make it look like it should.
It's not that complicated to edit numbers really... just ship the theme with 10 color variations or so and include instructions on how to edit the numbers in the CSS. If you can't figure out a forum's ID, you really shouldn't be trying to run a forum.
Yes, it's easy to do if I was going to be using the theme myself. But I'm talking about a released theme, where there are lots of variables involved.
Even still, it's not complicated at all. iirc one of Audentio's themes used this method.
Link?
Pages: 1 2