Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Solution for 3 column links

Quote Reply
Solution for 3 column links
hi,

i've come up with a solution to display links in 3 columns - it's a minor tweak of the code in the link below for 2 columns...

See this thread for the 2 colum code

if someone can have a look at the global i've made and show me how to extract the html back out into the template it would be great! it would be a lot tidier if it returned a either true / false and the html was selected in the template.

here's how I did it anyway...

1. make a global called "finishcolumns"

Code:
sub {

my $num = $_[0];

$num++;

if ( $num % 3 ) {
return "<TD width=\"200\">&nbsp;</TD><TD width=\"200\">&nbsp;</TD>";
} else {
return "<TD width=\"200\">&nbsp;</TD>";
}


}

2. replace the code below in the 2 column mod...

Code:
<%if row_num % 2 eq 1%> <%-- balance the trailing rows --%>
<TD></TD><TD></TD>
<%endif%>

with this...

Code:
<%finishcolumns($row_num)%>

and you're done.


let me know if anyone can see a way to make it better.

cheers,
regan.
Subject Author Views Date
Thread Solution for 3 column links ryel01 1992 Jun 14, 2002, 4:31 PM
Thread Re: [ryel01] Solution for 3 column links
Paul 1959 Jun 14, 2002, 4:35 PM
Thread Re: [Paul] Solution for 3 column links
ryel01 1954 Jun 14, 2002, 4:48 PM
Post Re: [ryel01] Solution for 3 column links
Paul 1945 Jun 15, 2002, 2:29 AM