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


In reply to HTML attribute based template language for perl? by jeorgen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.