Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

HTML attribute based template language for perl?

by jeorgen (Pilgrim)
on Sep 07, 2002 at 12:34 UTC ( #195869=perlquestion: print w/replies, xml ) Need Help??

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

Replies are listed 'Best First'.
Re: HTML attribute based template language for perl?
by JaWi (Hermit) on Sep 07, 2002 at 12:44 UTC
    I recently joined a group which builds a system for ordering books online. They use XML stylesheets (XSLT, CPAN) in combination with XML.

    Normally I don't like ``hyped technologies'', but XSLT is really cool: it is a very powerful meta-language capable of doing all sorts of neat things, like outputting text using conditional statements, similar to the example code you gave.

    Greets,

    -- JaWi

    "A chicken is an egg's way of producing more eggs."

Re: HTML attribute based template language for perl?
by valdez (Monsignor) on Sep 07, 2002 at 14:52 UTC

    It's a really interesting approach, used already in a module called Petal, Perl Template Attribute Language. May be you can join efforts with its author.

    Ciao, Valerio

Re: HTML attribute based template language for perl?
by perrin (Chancellor) on Sep 07, 2002 at 15:35 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://195869]
Approved by TStanley
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-11-29 08:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?