Re: [Templates] Overriding the default iterator
[prev]
[thread]
[next]
[Date index for 2004/09/03]
Adam,
> Of course, there's always Template::Plugin::Cycle, designed for just
> your sort of situation... especially if you just want row backgrounds
> and such.
Well, I will definitely look into that, as that is one thing (probably
the most common thing) I use it for. But there are other things as
well; for instance, just last night I did a six-column table that was,
from the user perspective, two columns, each cell of which had 3 items
in it. So I did something like this:
<table ...>
[% FOREACH method IN all_methods %]
[% '<tr>' IF loop.count % 2 == 1 %]
<td> <input type="radio" name="method" value="[%
method.id %]"> </td>
<td> [% method.rate %] </td>
<td> [% method.name %] </td>
[% '</tr>' IF loop.count % 2 == 0 %]
[% END %]
</table>
So, in that instance, I think having an "odd" (and an "even", natch)
would make it more legible for the non-programmers.
Andy,
> Yep, set the $Template::Config::ITERATOR package variable to contain
> the name of your iterator module.
Excellent! Sounds very simple. Thanx for the tip.
-- Buddy
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
 |
Re: [Templates] Overriding the default iterator
Buddy Burden 16:36 on 03 Sep 2004
|