Gossamer Forum
Home : Products : Gossamer Links : Discussions :

loop columns

Quote Reply
loop columns
i use loops to display the category list for some reason, but anyway, how is it possible to display something from loops in 2 columns?
Quote Reply
Re: [xpert] loop columns In reply to
Have a look at the following thread. It's not exactly what you want, but can easily change it to always display two columns (basically just replace

my @new_col_at = qw/5 10 20/;

with

my @new_col_at = qw/0/;

(or maybe it should be 1, instead of 0, you have to test this).

http://www.gossamer-threads.com/...rum.cgi?post=212197;

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] loop columns In reply to
I use this for 2 cols....

Code:
<table width="90%" cellpadding="10">
<tr>
<%loop category_loop%>
<%if loop_iteration % '2' and loop_iteration > '1'%>
</tr><tr>
<%endif%>
<td>
<%cat_name%>
</td>
<%endloop%>
</tr>
</table>

Thats from one of my own scripts so you'd need to change the tag names but apart from that it should work.

Last edited by:

Paul: Sep 8, 2002, 12:22 PM
Quote Reply
Re: [Paul] loop columns In reply to
Paul, have you ever had any problems with not closing the <td> spare <td> tag ... i am just worried about ending up with

<table>
<tr>
<td>something</td>
<td>something else</td>
<td>one more</td>
</tr><tr>
<td>something else</td>
</tr></table>

not the best html out there ... and it likely to cause problems if you start bgcoloring the table cells ...

any ideas?
---------------------------------------------
DeskPRO.com http://www.deskpro.com?r=gt
vBulletin.com Moderator and Support http://www.vbulletin.com/
Quote Reply
Re: [xpert] loop columns In reply to
If you look here...

http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=200916;search_string=columns;#200916

I've posted a solution to display an infinate number of links in columns. It properly formats the empty table cells also to avoid it jumping around.

r.
Quote Reply
Re: [ryel01] loop columns In reply to
Clever, thanks :)
---------------------------------------------
DeskPRO.com http://www.deskpro.com?r=gt
vBulletin.com Moderator and Support http://www.vbulletin.com/
Quote Reply
Re: [padders] loop columns In reply to
Hi,
Saw this post and think that you people might have a solution for my requirement...
Its similar just that i want the categories to be listed like this:
A B C D
E F G H
I J K L

I'am using category_loop but it just lists the categories in a single line.....
How do i alter the category_loop code which i have embedded in the template:

<%loop category_loop%>
<tr><td class="specLst"> &#149 <a href="/car-rentals/<%category_file_name($Short_Name)%>.html"><%Short_Name%></a></td></tr>
<%endloop%>

i do not have variables like row_num and cat_nums available as well donno why but they were not listed when i used the tag <%GT::Template::dump%> in the template, just need to write simple logic to manipulate trs and tds.
Can i do that ?


Kamal
Quote Reply
Re: [kamalrajm] loop columns In reply to
Hi,

Try using row_num, etc. and see what happens. They are special tags that don't show up in the tag dump.