http://qs321.pair.com?node_id=195869

jeorgen has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,
Is there a template language for perl like Zope's TAL/TALES ?

Most template languages today suffer from a tag-invention frenzy. It is in many ways smarter to embed template instructions in attributes of existing elements like so:

<table border="1" width="100%"> <tr> <th>Number</th> <th>Id</th> <th>Meta-Type</th> <th>Title</th> </tr> <tr tal:repeat="item container/objectValues"> <td tal:content="repeat/item/number">#</td> <td tal:content="item/getId">Id</td> <td tal:content="item/meta_type">Meta-Type</td> <td tal:content="item/title">Title</td> </tr> </table>
The code is taken from the Zope page template documentation. Please note that dummy information is also present. It's also possible to fake more rows to make for a more realistic template to layout.

This week I coded an cgi app for a campaign for a customer using HTML::Template as template language. The customer wanted a lot of last-moment changes and in the end it was pretty well nigh impossible to make any WYSIWYG changes with FrontPage 2000 (FP2000 does otherwise a good job of leaving the Template tags alone).

The customer had problems editing the look of the campaign and some dummy contents had been perfect. Is there or is there underway such HTML attribute based template language with dummy contens for perl?

A criticism raised at languages such as Zope page template is that you often build up a page from smaller parts, and so, there is no whole page for the page designer to edit. Hower in Zope page templates there is a macro language, METAL, that allows insertion of components. And when editing a template, these macros are evaluated. To quote the documentation:

"If you check the Expand macros when editing option on the Page Template Edit view, then any macros that you use will be expanded in your template's source. This is Zope's default behavior, and in general this is what you want, since it allows you to edit a complete and valid page."

Here is a discussion from advogato on the same subject. cheers

/jeorgen