![]() |
Picking Alternate Posts With A Conditional
I'm trying to pick out ever alternating post with a conditional. I recall successfully doing this with
Code:
<vb:if condition="$post['postcount'] % 2 == 0"> However with 4.1.2 it doesn't seem to work. Or I just cant remember the correct coding. Could anyone please shed some light? A typical usage would be to have alternating postbit colours. Thank You. |
What template are you putting this in? And can we see exactly what you are adding and where?
|
I basically want the postbit userinfo to alternate. Left and Right. Ive done it before. I just haven't used VB for awhile and cant remeber how the heck I did it for the life of me as my forum was pretty much closed down.
What I do know is that I used it in the postbitlegacy template. And basically I used a second CSS for userinfo (i.e userinfo1) with a float right. Code:
.postbitlegacy .userinfo1 { Code:
<div class="postdetails"> Any ideas? Thanks. |
You do see that you have the same class in both the if and else?
HTML Code:
<div class="userinfo"><vb:else /><div class="userinfo"> |
My bad I typed that out half asleep. whee hours of the morning here lol. Pretty sure I used different classes when I tried it.
Odd. I shall check it again in the a.m and post back. But basically you implemented exactly what I posted above yes ? |
I implemented the class change in my postbit_legacy and it worked. I did not check your CSS, but the class is definitely changing in alternate posts.
|
The CSS needed to be changed in more than one place. Postdetails needed to be aligned as well. And another conditional needed to be added. Not too shabby.
Thanks Lynne |
All times are GMT. The time now is 10:09 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|