in reply to Re^4: Generation of dynamically-static documents
in thread Generation of dynamically-static documents
And putting code of any sort into the template wasn't exactly what I was hoping for.
Well, I don't consider putting presentational code near the templates as a sin :-) So, to pick one of your examples, if I was looking at a TT2 solution I'd package up a TT2 Officers plugin that wrapped up all the presentation aspects of the officers and then have a template that did something like:
[% USE Officers %] ... <table> <tr> <th>Name</th> <th>Phone</th> </tr> [% FOREACH officer = Officers.by_name %] <tr> <td>[% officer.name %]</td> <td>[% officer.phone %]</td> </tr> {% END %] </table> ...
So the [% USE Officers %] tells the template, and therefore ttree, what code needs running. I find something like this is often a nice solution. I'm providing a clean presentation object that can't be perverted into evil business logic in the templates, and the designers can go do presentational things with Officers wherever they like without me having to touch any more code.
|
|---|