Hey Martijn --

> Thanks for the idea, it works well and it doesn't increase 
> the number of 
> templates.

One thing to consider:  In your single template file you now have one big
template with two parts, separated with a <TMPL_IF>.  This forces you to
make one "upstream" decision:

        $t->param('EXCEL' => 1) if (in_excel_mode());


If you have to make one decision, anyway, why not instead:

        my $tmpl_file = (in_excel_mode()) ? 'csv.tmpl' : 'html.tmpl';


What is the down-side of having two separate template files?  Yes, you would
have to edit them separately -- but you really have "two files in one" in
the single-file solution, anyway.  In a single file both parts contain
redundancies which have to be edited separately, even though they are in the
same file!

For the marginal advantage of only opening a single file, you now have two
"file parts" which are each individually more complicated, as a result.  It
is now more difficult to make changes to one, because you have to concern
yourself with the contents of the other.


IMHO,

-Jesse-



  Jesse Erlbaum, CTO
  Vanguard Media
  http://www.vm.com
  212.242.5317 x115
  [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to