It seems as if there needs to be a general templating mailing list...

Here I have a comment about comparing template systems, and then I solicit
advice on which system to use...

The only reason I'm using my own templating system (besides the requirement
that everyone writes one) is because I realized it would take me less time
to code up a simple one than wade through all the available packages,
downloading, installing, and trying each out.  And frankly, some are so
feature-rich that they scared me off - I wanted a template system in my
application, not the other way around.

I really should leave the programming to The Experts, so having a nice
comparison of features would be a huge help, and it might have convinced me
to pick one of the available systems.

In additions to a comparison of features, people (including me) might find
it useful to have a general overview and comparison of the different
templating _technologies_ and what type of applications work well with each
and why.  

In my mind, almost all my applications seem to fit a system where a my
application uses the templates, instead of the templates using my
application.  In other words, URLs map to the application and not to pages.
 I assume the likes of TT and HTML::Template fit this, but Embperl, Mason,
and ASP are more based on URLs mapping to templates.  Maybe this is an
incorrect assumption?

I'd also like to see and compare which ones are designed to work best with
mod_perl, and the benefits that mod_perl provides the system.  

It seems like each of the various templating web sites have great info, but
it would just be very helpful to see it in one place and see each compared
against the others.


Now, I think I have rather simple needs.  I'm not sure which current system
best fits.  The tricky part for me is when used with co-branding.  Any
suggestions?

Here is what I need:

- Get HTML out of my code, but limit code in templates as non-perl people
will be editing the templates --  although I need ways to do some tricks in
the templates like changing the bgcolor of a row of a table if some
condition is met, or adding an additional column to every row if data in
one row meets some condition.

- Shared template cache across server children, plus some smart way to
detect changed templates without doing a stat() on every request (which is
what I'm currently doing -- and since my templates are full of INCLUDEd
other templates, that's a bunch of stats).

- Not sure if it makes much difference in speed, but parts of my templates
only need to be filled in when first loaded off disk since the data is
static once loaded (e.g. base url, base path, titles).  Other parts are
filled in with each request, as is common.

- Easy way to handle co-branding (partners/views).  I have a site that is
used by a number of other sites -- basically our site is wrapped in their
"look".

Admittedly, I could probably use a better design.  My program maps various
pages of the application (e.g. main page, search page, results page, error
page, help page) to different template files.  

Say all the templates are stored in the "templates" directory.
Subdirectories in the "templates" directory contain the templates for each
of the co-branded sites.  When running as co-branded the template mapper
first looks in the co-branded subdirectory for the template, then if not
found there, looks in the top level templates directory for a template of
the same name.  More helpful in my case, the same process works for
templates included within templates so that many of the templates (and
included templates) are shared.  I guess that's someone like the
"components" feature of Mason.

- I'm not sure how I feel on this issue: I want my templates to be limited
in what data they can access, but I also don't want to have to specify or
pass the exact data my template will use to the template system.  When the
HTML people want to add a new field on the page I don't want to have to
always go into the application and provide that new data to the template --
and that defeats one of the purposes of the template system.


So, any suggestions on what one or two templating systems I should try that
would do at least the above?

Thanks,

Bill Moseley
mailto:[EMAIL PROTECTED]

Reply via email to