You need a loop.  See the HTML::Template docs on LOOPS.

<tmpl_loop name="sites">

<tmpl_var name="site_id"><br>
<a href="<tmpl_var name="site_url">"><tmpl_var name="site_name"></a>

</tmpl_loop>


You pass a loop (AKA, "sites => \@sites_array_of_hashref," ) with the
necessary sites.  This loop construction is business-logic (we would use a
module that prepared an array of hashrefs from a DBI routine.)

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Fran Fabrizio
> Sent: Tuesday, August 13, 2002 5:54 PM
> To: HTML::Template List
> Subject: [htmltmpl] Dynamic TMPL_VAR names? Is it possible?
>
>
>
> Hello!  What I'm wondering is if this is possible:
>
> <input type=text
>          name=site_<tmpl_var site_id>_name
>          value=<tmpl_var site_<tmpl_var site_id>_name>
> >
>
> We're trying to use the 'associate' feature, but the form field names
> need to be unique each time we load the form (because the form may
> have site_12345_name and site_67890_name this field can't be just
> site_name) and thus the value= has to be formed the way I'm trying
> above, which breaks HTML::Template.  Is there another way to achieve
> this?
>
> Thanks,
> Fran
>
>
>
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: Dice - The leading online job board
> for high-tech professionals. Search and apply for tech jobs today!
> http://seeker.dice.com/seeker.epl?rel_code=31
> _______________________________________________
> Html-template-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/html-template-users



-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to