Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [tondelo] Alternating Row Color

Quote Reply
Re: [tondelo] Alternating Row Color In reply to
Tony,

I prefer using the Global methods. Go to Build>Template Globals>

change the option:
link_results

from :
sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Hits DESC');
my $sth = $link_db->select;
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}



to what andy suggested:
sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Hits DESC');
my $sth = $link_db->select;
my $output = '';
my $cnt = 0;
while (my $link = $sth->fetchrow_hashref) {
if ($cnt / 2) {
$link->{even} = 1;
} else {
$link->{odd} = 1;
}

$output .= Links::SiteHTML::display('link', $link);
$cnt++;
}
return $output;
}



Then open link.html and add the
<%if odd%> odd color <%else%> even color <%endif%>



TRY THAT



Sandra Roussel
Chonsa Group Design - Fresh Start Housing

Last edited by:

SandraR: Mar 16, 2005, 10:35 AM
Subject Author Views Date
Thread; hot thread Alternating Row Color tondelo 12710 Mar 16, 2005, 6:22 AM
Thread; hot thread Re: [tondelo] Alternating Row Color
webmaster33 12221 Mar 16, 2005, 6:26 AM
Thread; hot thread Re: [webmaster33] Alternating Row Color
tondelo 12240 Mar 16, 2005, 7:13 AM
Thread; hot thread Re: [tondelo] Alternating Row Color
fuzzy logic 12151 Mar 16, 2005, 7:43 AM
Post; hot thread Re: [fuzzy logic] Alternating Row Color
webmaster33 12370 Mar 16, 2005, 7:49 AM
Post; hot thread Re: [tondelo] Alternating Row Color
webmaster33 12182 Mar 16, 2005, 7:46 AM
Post; hot thread Re: [tondelo] Alternating Row Color
webmaster33 12180 Mar 16, 2005, 7:59 AM
Thread; hot thread Re: [tondelo] Alternating Row Color
webmaster33 12174 Mar 16, 2005, 8:16 AM
Thread; hot thread Re: [webmaster33] Alternating Row Color
Andy 12169 Mar 16, 2005, 8:39 AM
Thread; hot thread Re: [Andy] Alternating Row Color
webmaster33 12518 Mar 16, 2005, 9:41 AM
Thread; hot thread Re: [webmaster33] Alternating Row Color
SandraR 12143 Mar 16, 2005, 9:47 AM
Thread; hot thread Re: [SandraR] Alternating Row Color
webmaster33 12175 Mar 16, 2005, 9:59 AM
Thread; hot thread Re: [webmaster33] Alternating Row Color
Andy 12068 Mar 16, 2005, 10:05 AM
Post; hot thread Re: [Andy] Alternating Row Color
webmaster33 12121 Mar 16, 2005, 10:20 AM
Thread; hot thread Re: [Andy] Alternating Row Color
SandraR 12167 Mar 16, 2005, 9:43 AM
Thread; hot thread Re: [SandraR] Alternating Row Color
fuzzy logic 12191 Mar 16, 2005, 9:49 AM
Thread; hot thread Re: [fuzzy logic] Alternating Row Color
tondelo 12133 Mar 16, 2005, 10:19 AM
Post; hot thread Re: [tondelo] Alternating Row Color
webmaster33 12105 Mar 16, 2005, 10:29 AM
Thread; hot thread Re: [tondelo] Alternating Row Color
SandraR 12097 Mar 16, 2005, 10:33 AM
Thread; hot thread Re: [SandraR] Alternating Row Color
webmaster33 12172 Mar 16, 2005, 10:43 AM
Post; hot thread Post deleted by SandraR
SandraR 12078 Mar 16, 2005, 10:45 AM
Thread; hot thread Re: [webmaster33] Alternating Row Color
tondelo 12072 Mar 17, 2005, 7:36 AM
Thread; hot thread Re: [tondelo] Alternating Row Color
webmaster33 12040 Mar 17, 2005, 7:57 AM
Thread; hot thread Re: [webmaster33] Alternating Row Color
tondelo 12046 Mar 17, 2005, 8:16 AM
Thread; hot thread Re: [tondelo] Alternating Row Color
webmaster33 6283 Mar 17, 2005, 8:31 AM
Thread; hot thread Re: [webmaster33] Alternating Row Color
tondelo 6149 Mar 17, 2005, 8:59 AM
Post; hot thread Re: [tondelo] Alternating Row Color
webmaster33 6157 Mar 17, 2005, 9:22 AM
Thread; hot thread Re: [tondelo] Alternating Row Color
Andy 6155 Mar 17, 2005, 9:23 AM
Thread; hot thread Re: [Andy] Alternating Row Color
tondelo 6122 Mar 17, 2005, 12:55 PM
Thread; hot thread Re: [tondelo] Alternating Row Color
Andy 6112 Mar 18, 2005, 12:20 AM
Thread; hot thread Re: [Andy] Alternating Row Color
webmaster33 6162 Mar 18, 2005, 2:16 AM
Thread; hot thread Re: [webmaster33] Alternating Row Color
tondelo 6109 Mar 18, 2005, 4:44 AM
Post; hot thread Re: [tondelo] Alternating Row Color
webmaster33 6108 Mar 18, 2005, 4:56 AM
Thread; hot thread Re: [tondelo] Alternating Row Color
webmaster33 6167 Mar 17, 2005, 9:30 AM
Post; hot thread Re: [webmaster33] Alternating Row Color
Andy 6179 Mar 17, 2005, 9:47 AM
Post; hot thread Re: [tondelo] Alternating Row Color
webmaster33 6174 Mar 17, 2005, 10:06 AM
Post; hot thread Re: [tondelo] Alternating Row Color
webmaster33 6069 Mar 18, 2005, 3:17 AM
Post; hot thread Re: [SandraR] Alternating Row Color
Andy 12069 Mar 16, 2005, 9:56 AM