View Full Version : Row (background) color based on prefix
Areku
09-20-2010, 08:33 AM
Hi
I want to color the background of every thread's row based on its prefix.
Ie. PREFIX A is red, PREFIX B is green, PREFIX C is yellow
Hence, having threads
A thread 1
A thread 2
B thread 3
C thread 4
A thread 5
would result in threads' rows colored as
A red thread 1
A red thread 2
B green thread 3
C yellow thread 4
A red thread 5
instead of the alternate default bluish colors ;)
Ideas?
Thanks!
Lynne
09-20-2010, 01:49 PM
Change the class of the background row based on the prefix and then define the classes in the CSS to be different for each color.
Areku
09-20-2010, 02:12 PM
Which translates into...?? ;)
(Sorry I just dont know where to start ;) are there IF clauses for the CSS??)
Thanks!!
BigJohnny
09-22-2010, 11:00 AM
you will need an if statement for the prefixid's I believe.
<if condition="$prefixid[id-goes-here]" OR $prefixid[other-id-goes-here]> (I'm fairly certain I have mangled that statement, but it's only an example as I don't know the exact code for prefixes)
then you would put your if statements around the code that builds the tables and rows, and it would check prefixes (IDs) and apply your changes.
You would also have to change the class of the tables based on the prefix, so you would need to make a variable for the class, and add multi css entries.
Lynne, am I way off here or am I at least in the ballpark?
Lynne
09-22-2010, 01:50 PM
You are going in the direction I would go (I'm sure there are many ways to do this). I'd find the row and add
class="<if condition="$threadinfo[prefixid]==xx">class1<if>"And then in the Main CSS area, I'd define class1:
.class1 {background:pink;}
Areku
09-23-2010, 08:05 AM
Thaaats it, ;) thanks!!!
^SuiCyde^
07-28-2013, 05:38 AM
You are going in the direction I would go (I'm sure there are many ways to do this). I'd find the row and add
class="<if condition="$threadinfo[prefixid]==xx">class1<if>"And then in the Main CSS area, I'd define class1:
.class1 {background:pink;}
I'm very interested in this, and I realize it was a long time ago that it was posted. I apologize!
How would I go about "finding the row" to add that entry?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.