in reply to HTML::Template - Two columns?
I did this using nested loops, but that means you'll need to
transform your array into rows of columns as described in other replies.
My code received a single array of products and turned it into rows of three product elements each. It works thusly:
Then in your template, you loop through both arrays:my @rows; while (@products) { push @rows, { 'loop_products' => [splice @products, 0, 3], }; } $template_body->param( loop_row => \@rows, );
Works fine if your columns flow across the row. Enjoy :)<TMPL_LOOP NAME=loop_row> <TMPL_LOOP NAME=loop_products> Display one product here. </TMPL_LOOP> </TMPL_LOOP>
In Section
Seekers of Perl Wisdom