PDA

View Full Version : Isolating the Alternating colors


lightnb
05-30-2006, 05:31 AM
Is it possible to issolate the alternate color one and two, on a per page basis?

If I make them look good on forum, home, then the posts look ugly (and are sometimes unreadable), and vise versa.

Unless there's a trick here I'm missing?

smacklan
05-30-2006, 11:16 AM
I would say it's possible, you would have to edit several templates and use the extra css settings to define what you want to appear in each of those table cells.

Sean S
05-30-2006, 01:32 PM
Yes the only way to do this is what smacklan mentioned, you have to edit the templates. However, if you don't want the alternating row colors at all, just set the background colors of both to the same color and then you will have to edit less templates.

lightnb
05-30-2006, 04:38 PM
I'd like to use graphics on them, so on the forum home, they could be gradients, but in the actuall post, it's a solid color to make the text more readable.

Sean S
05-31-2006, 09:56 PM
yes in that case you will have to eidt the templates, templates that you want to look into are the forumhome, and postbit or postbit_legacy depending on the postbit style you have set for your forums.

Adrian Schneider
06-01-2006, 02:26 AM
Just redefine them conditionally in the headinclude template... <if condition="THIS_SCRIPT == 'someScript'">
<style type="text/css">
<!--
.alt1 {
background: #000 url('someGradient.gif');
}
.alt2 {
background: #000 url('someOtherGradient.gif');
}
-->
</style>
</if>

lightnb
06-01-2006, 03:01 AM
Just redefine them conditionally in the headinclude template... <if condition="THIS_SCRIPT == 'someScript'">
<style type="text/css">
<!--
.alt1 {
background: #000 url('someGradient.gif');
}
.alt2 {
background: #000 url('someOtherGradient.gif');
}
-->
</style>
</if>

Thanks. :) Could you give an example of what 'somescript' might be? are those templates or PHP files?

Adrian Schneider
06-01-2006, 03:13 AM
PHP files. You can check what THIS_SCRIPT is set to at the top of each PHP file. Note that it is a constant, not a variable.

You could also do the opposite (well, same thing really): set just "showthread" to a plain color, and in the adminCP, set the alt1/alt2 to gradients. There are only a few other places where actual posts are shown...

lightnb
06-02-2006, 07:01 AM
Could I just add a CSS definition for .forum_home_alt1 in the Admin CP, and then change the class in the Forum_Home template?

Sean S
06-02-2006, 04:07 PM
yes you can.