APM: Looking for a good HTML templating system

Chris Tooley chris at tooley.com
Thu Oct 27 07:25:47 PDT 2005


We use HTML::Template extensively and I really like it.  We've used it
for a long time.  Like Smarty it has some quirks, but it's light, and
easy to use, and since it's integrated well with CGI::Application it
doesn't require any extra effort to use if you're using
CGI::Application.

If you're dead set on getting rid of HTML::Template though, I highly
recommend Template Toolkit.  TT allows you to do a lot of logic things
in the template, but you can generally ignore them and use it
specifically for layout.  It also has the added benefit of being good
for exporting the content in the template (with some prior care in the
layout) to multiple things besides just HTML.  So you can generate PDFs
for instance.  If you're working on something for a company that does
press releases, the content can all go in one place and marketing gets
the website updated, PDF's to send out as press releases, and something
to put in their file, all in the same layout engine.

TT is probably heavier than what you were looking for but unlike most of
the heavy template engines it adds benefits beyond just web layout.  It
does however have a lot of benefits and version 3 which is coming soon,
should add some support for other languages as well.


> --- Bob Apthorpe <apthorpe+pm at cynistar.net> wrote:
> 
> > Hi,
> > 
> > It's been a while since I've done any CGI programming in perl but
> > recently I took on a project where we're using HTML::Template to
> > render
> > pages. My preference is to use a templating system to separate the
> > logic
> > from the presentation and most recently I've been using PHP and the
> > Smarty template system for web application development. Smarty has
> > its
> > quirks but it's easy enough to pass complex data structures into a
> > template to generate rather elaborate pages.
> > 
> > Not having any previous experience with HTML::Template aside from
> > perldoc and some trivial examples, how do the two tools compare? Is
> > there a better system to use that does not require mod_perl? I'm
> > specifically eliminating HTML::Mason because it's too heavyweight for
> > what I'm trying to do, i.e. I'm looking more for a templating system
> > than an application framework (I'm still learning Rails...)
> > 
> > The application is not expected to be high traffic so it can run as a
> > CGI without worrying much about performance. Conversely, this is for
> > a
> > client and I would rather not have to specify a highly-tuned
> > ("hacked")
> > Apache configuration, which is why I don't want to mess with
> > mod_perl.
> > 
> > Google turns up
> > http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html
> > and after reading that, I think Template Toolkit bears some
> > investigation. Still, I'd appreciate hearing people's experiences
> > with
> > perl templating systems.
> > 
> > Thanks,
> > 
> > -- Bob
> > _______________________________________________
> > Austin mailing list
> > Austin at pm.org
> > http://mail.pm.org/mailman/listinfo/austin
> > 
> 
> 
> 
> 		
> __________________________________ 
> Yahoo! FareChase: Search multiple travel sites in one click.
> http://farechase.yahoo.com
> _______________________________________________
> Austin mailing list
> Austin at pm.org
> http://mail.pm.org/mailman/listinfo/austin
-- 
Chris Tooley
512-646-1507
ctooley at gnumber.com



More information about the Austin mailing list