Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Alternating rows without relying on PHP
Michael Morris
Join Date: Nov 2003
Posts: 774

Employee of Digital Media Graphix of Knoxville TN, currently developing a new framework / CMS

Knoxville TN
by Michael Morris Michael Morris is offline 14 Oct 2007

Here's a way to alter row colors using vbulletin's template engine without using any outside functions.

At the beginning of your rowbit template place the following code.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Now for each row that you need to have alternate colors place the following code where the class name would go.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Below is a complete example using one of the forumbit templates.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Views: 7306
Reply With Quote
Comments
  #2  
Old 27 Oct 2007, 00:48
Audentio's Avatar
Audentio Audentio is offline
 
Join Date: Mar 2007
Real name: Mike
Now THAT is nice. Great work, I can definitely use this in some of my designs.
Reply With Quote
  #3  
Old 01 Nov 2007, 20:32
TheMilkCarton TheMilkCarton is offline
 
Join Date: Jan 2007
Wow. Thanks.. So much easier than what I had planned...

Works very well with modules from vBadvanced, too. I modified the news.php file to be a comments system, and now it looks really nice!

Thanks!
Reply With Quote
  #4  
Old 05 Nov 2007, 07:15
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Real name: Michael Morris
Thanks.
Reply With Quote
  #5  
Old 13 May 2008, 19:45
Mazinger's Avatar
Mazinger Mazinger is offline
 
Join Date: Nov 2006
Location: Egypt
Great! Thanks!
__________________
موقع اخبار مصر واخبار الرياضة والدولار في دليل مصر
Reply With Quote
  #6  
Old 13 May 2008, 19:57
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Real name: Anton Kanevsky
Why would you not want to rely on the built-in switcher?
__________________
I can no longer support any of my hacks. Please do not contact me for that. Feel free to create and post new versions of my hacks, as long as you give me credit for the original work.
Reply With Quote
  #7  
Old 07 Jun 2008, 03:15
stanleys stanleys is offline
 
Join Date: Dec 2007
You can also do it via Javascript if you have a framework like jQuery or Prototype installed:

$("tr: odd").addCLass('altRow');

(remove the space between the : and the o)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 18:05.

Layout Options | Width: Wide Color: