[Templates] multiple uses of component-like template

Dustin Frazier dustin.frazier@gmail.com
Thu, 3 May 2007 13:04:16 -0700


I have a template that I use to create a two-column layout in a  
standard way.  The template looks something like:

<table>
<tr>
<td>
[% INCLUDE left %]
</td>
<td>
[% INCLUDE right %]
</td>
</tr>
</table>

(There's more to the real template to setup classes and styles to  
manage column width, spacing, etc., and yes I know using CSS would be  
better [for some definition of "better"]).

I then use the template like so:

[% WRAPPER two_columns %]
[% BLOCK left %]
stuff for left column
[% END %]
[% BLOCK right %]
stuff for right column
[% END %]
[% END %]

This works great until I try to use the two_columns template more  
than once on a page.  When I try that, the *last* instance of the  
'left' and 'right' block is used in each use of the wrapper template.

Is there a better practice for accomplishing this kind of component- 
like behavior each with multiple content blocks?

Dustin