The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Please help: making alternating row background color in threadbit?
Hi
I am trying to set alternating row background color in threadbit. After searing around, I found this: http://www.vbulletin.com/forum/showt...=1#post1490421 I altered the code (see below) and tried it to find I am getting only "alt1" from {vb:raw $altclass} . Maybe there's something else I need to do? Please help and thank you in advance WC Code:
<vb:if condition="!isset($altrow)"> <vb:if condition="$altrow = 0"></vb:if> </vb:if> <vb:if condition="++$altrow % 2 == 0"> <vb:if condition="$altclass = 'alt2'"></vb:if> <vb:else /> <vb:if condition="$altclass = 'alt1'"></vb:if> </vb:if> ...{vb:raw $altclass} |
#2
|
||||
|
||||
Hmmm, haven't really tried anything like that in vB4, but did you try either preregistering the variable or creating one in an array that is already registered? ($post['altclass'] ?)
|
#3
|
|||
|
|||
Quote:
I don't really know how to do that. Do I just replace $altclass with $post['altclass'] ? Code:
<vb:if condition="!isset($altrow)"> <vb:if condition="$altrow = 0"></vb:if> </vb:if> <vb:if condition="++$altrow % 2 == 0"> <vb:if condition="$post['altclass'] = 'alt2'"></vb:if> <vb:else /> <vb:if condition="$post['altclass'] = 'alt1'"></vb:if> </vb:if> then put class=" {vb:raw $post['altclass'] } " |
#4
|
||||
|
||||
Try it and see. (You forgot the ones in the top four rows.)
|
#5
|
|||
|
|||
Why dont you use nth-child css selector?
|
#6
|
||||
|
||||
Does that work for all browsers? I know some pseudo classes are wonky with some browsers.
|
#7
|
|||
|
|||
Does not work with all browser. It works for lastest versions of browser. But not for IE, maybe in IE 9.
|
#8
|
|||
|
|||
Hi Lynne,
I just put this before threadbit now. I am getting only "alt1" for {vb:raw $post['altclass'] } in every row.. Thanks WC Code:
<vb:if condition="!isset($post['altrow'] )"> <vb:if condition="$post['altrow'] = 0"></vb:if> </vb:if> <vb:if condition="++$post['altrow'] % 2 == 0"> <vb:if condition="$post['altclass'] = 'alt2'"></vb:if> <vb:else /> <vb:if condition="$post['altclass'] = 'alt1'"></vb:if> </vb:if> |
#9
|
||||
|
||||
For some reason, I thought you were talking about the postbit...argh! $post is not a variable available in the threadbit template. You can try $thread instead of $post. Sorry about that. And, I'm assuming you define alt1 and alt2 somewhere.
|
#10
|
|||
|
|||
Hi Lynne,
Thanks for the help. I put the following code before threadbit and I am still getting only "alt1" from {vb:raw $thread['altclass'] }... Anything else I can try? WC Code:
<vb:if condition="!isset($thread['altrow'] )"> <vb:if condition="$thread['altrow'] = 0"></vb:if> </vb:if> <vb:if condition="++$thread['altrow'] % 2 == 0"> <vb:if condition="$thread['altclass'] = 'alt2'"></vb:if> <vb:else /> <vb:if condition="$thread['altclass'] = 'alt1'"></vb:if> </vb:if> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|