Best I can come up with is to create a second, flat version of the list:
[% flat_months = [ '' ];
flat_months = flat_months.merge(months);
CGI.popup_menu(name => 'month',
values => flat_months,
default => this_month,
) %]
Jason
apv wrote:
> Sent: Thursday, July 21, 2005 2:53 AM
> To: [email protected]
> Subject: [Templates] how to flatten/dereference a list
>
> I hope this isn't a stupid question, I couldn't find it in the docs.
>
> I'm doing this kind of thing where the 'months' is [ qw( Jan
> ".." Dec )
> ] but for some cases I'd like to have an empty slot in the months.0.
>
> Using:
> [% CGI.popup_menu(name => 'month',
> values => months,
> default => this_month,
> ) %]
>
> Would like the equivalent of:
> [% CGI.popup_menu(name => 'month',
> values => [ '', months.FLATTENED ],
> default => this_month,
> ) %]
>
> I am reusing the 'months' here and there so I don't want to alter it
> directly. Ideas?
>
> Thank you!
> -Ashley
>
>
> _______________________________________________
> templates mailing list
> [email protected]
> http://lists.template-toolkit.org/mailman/listinfo/templates
>
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates