Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-19 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found