shabbirbhimani
Active member
Had an alternating row color for vBulletin without a plugin and wanted something similar for Xenforo. I know this is not the best way to be doing it and as Xenforo is on MVC structure may not be recommended as well but the simplicity of it made me to share it here.
In thread_view template, Find
And replace with
In message template find
And add the class as follows
Finally Add the following to message.css template
Enjoy !!!
In thread_view template, Find
HTML:
<xen:foreach loop="$posts" value="$post">
And replace with
HTML:
<xen:set var="$i">0</xen:set>
<xen:foreach loop="$posts" value="$post">
<xen:set var="$j">{$i}</xen:set>
<xen:set var="$i">{xen:calc '{$j}+1'}</xen:set>
<xen:if is="{$i}%2==0">
<xen:set var="$AltColor">Even</xen:set>
<xen:else/>
<xen:set var="$AltColor">Odd</xen:set>
</xen:if>
In message template find
HTML:
<li id="{$messageId}" class="message
And add the class as follows
HTML:
<li id="{$messageId}" class="{$AltColor} message
Finally Add the following to message.css template
HTML:
.messageList .Even, .messageList .Even .primaryContent {background:@primaryLightest;}
Enjoy !!!