You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Sam Tregar <sa...@tregar.com> on 2000/12/18 00:21:02 UTC

ANNOUNCEMENT: NEW VERSION: HTML::Template 2.1

ANNOUNCEMENT: NEW VERSION: HTML::Template 2.1

HTML::Template - a Perl module to use HTML Templates

CHANGES

2.1

- New Feature: new 'file_cache' and 'double_file_cache' options
  provide a file based caching method (T.J. Mather)

- New Feature: new 'print_to' option for output() allows output() to
  print to a filehandle as it runs.  (Chris Nokleberg)

- New Feature: new 'case_sensitive' option to allow template variable
  names to be case sensitive. (Matthew Wickline)

- New Feature: new 'filter' option allows pre-parse filtering of
  template files.

- Bug Fix: added single-quote escaping to HTML escaping code
  (Ralph Corderoy)

- Bug Fix: fixed a noisy bug in param() when used with 'associate'
  (William Ward)

DESCRIPTION

This module attempts make using HTML templates simple and natural.  It
extends standard HTML with a few new HTML-esque tags - <TMPL_VAR>,
<TMPL_LOOP>, <TMPL_INCLUDE>, <TMPL_IF>, <TMPL_UNLESS> and <TMPL_ELSE>.
The file written with HTML and these new tags is called a template.
It is usually saved separate from your script - possibly even created
by someone else!  Using this module you fill in the values for the
variables, loops and branches declared in the template.  This allows
you to seperate design - the HTML - from the data, which you generate
in the Perl script.

A Japanese translation of the documentation is available at:

   http://member.nifty.ne.jp/hippo2000/perltips/html/template.htm

This module is licenced under the GPL.  See the LICENCE section of the
README.


AVAILABILITY

This module is available on SourceForge.  Download it at:

  http://download.sourceforge.net/HTML-Template/HTML-Template-2.1.tar.gz
  http://download.sourceforge.net/html-template/HTML-Template-2.1.tar.gz
The module is also available on CPAN.  You can get it using CPAN.pm or
go to:

  http://www.cpan.org/authors/id/S/SA/SAMTREGAR/


MOTIVATION

It is true that there are a number of packages out there to do HTML
templates.  On the one hand you have things like HTML::Embperl which
allows you to freely mix Perl with HTML.  On the other hand lie
home-grown variable substitution solutions.  Hopefully the module can
find a place between the two.

One advantage of this module over a full HTML::Embperl-esque solution
is that it enforces an important divide - design and programming.  By
limiting the programmer to just using simple variables and loops in
the HTML, the template remains accessible to designers and other
non-perl people.  The use of HTML-esque syntax goes further to make
the format understandable to others.  In the future this similarity
could be used to extend existing HTML editors/analyzers to support
this syntax.

An advantage of this module over home-grown tag-replacement schemes is
the support for loops.  In my work I am often called on to produce
tables of data in html.  Producing them using simplistic HTML
templates results in CGIs containing lots of HTML since the HTML
itself could not represent loops.  The introduction of loop statements
in the HTML simplifies this situation considerably.  The designer can
layout a single row and the programmer can fill it in as many times as
necessary - all they must agree on is the parameter names.

For all that, I think the best thing about this module is that it does
just one thing and it does it quickly and carefully.  It doesn't try
to replace Perl and HTML, it just augments them to interact a little
better.  And it's pretty fast.


DOCUMENTATION

The documentation is in Template.pm in the form of POD format
perldocs.  Even the above text might be out of date, so be sure to
check the perldocs for the straight truth.


CONTACT INFO

This module was written by Sam Tregar (sam@tregar.com) for Vanguard
Media (http://www.vm.com).  You can join the HTML::Template
mailing-list by sending a blank message to
htmltmpl-subscribe@lists.vm.com.



---------------------------------------------------------------------
To unsubscribe, e-mail: htmltmpl-unsubscribe@lists.vm.com
For additional commands, e-mail: htmltmpl-help@lists.vm.com


Re: ANNOUNCEMENT: NEW VERSION: HTML::Template 2.1

Posted by Sam Tregar <sa...@tregar.com>.
On Mon, 18 Dec 2000, Eric Cholet wrote:

> > ANNOUNCEMENT: NEW VERSION: HTML::Template 2.1
>
> Does it support ELSIF yet?

Nope, but you can build your own now with the new filter option.  I expect
someone to post up an "ELSIF" => "ELSE IF" filter to the HTML::Template
mailinglist any time now.

-sam


Re: ANNOUNCEMENT: NEW VERSION: HTML::Template 2.1

Posted by Eric Cholet <ch...@logilune.com>.
> ANNOUNCEMENT: NEW VERSION: HTML::Template 2.1
> 
> HTML::Template - a Perl module to use HTML Templates
> 

Does it support ELSIF yet?

--
Eric