On Sat, Jul 06, 2002 at 02:59:34PM -0500, Shannon, Bryan wrote:
> The best way would probably be having the template re-write itself when it
> gets parsed. It could turn all of my templates [% data.field_c %] into [%
> data.4 %] "behind the scenes" while it is being parsed. This could probably
> be done by sub-classing the Template::Parser object....
That certainly sounds possible. But there's also a low-tech solution
which you might want to consider first: two-pass templates.
You create a template like so:
[% FOREACH data = dataset %]
blah blah [* data.field_c *] blah blah
[% END %]
You define your data like so:
data => {
field_c => '[% data.4 %]',
...etc...
}
and then you pre-process your templates with TAGS set to 'star'.
This generates your second template which looks like:
[% FOREACH data = dataset %]
blah blah [% data.4 %] blah blah
[% END %]
Cheers
A