It's interesting to me that all of the responses to this post have discussed using templates for creating web pages. Whilst I do like to use TT2 to create web pages, one of the things that draws me towards that system rather than something like HTML::Mason or HTML::Template is that it is purely a templating system and doesn't assume that it's being used to produce HTML. You can use it just as well to produce just about any other type of ourput.

For example, I'm just working on an article which demonstrates how I've used TT2 to produce XML files which make up a data feed that we pass on to our customers. I'm also working on a design so that my company can produce all of its invoicing and form letters with templates. The templates will be LaTeX files which will contain TT2 directives which expand to display the relevant data. In both of these examples, the main advantage is, once more, the fact that the designers of the XML files or the invoice templates don't need to know any Perl at all.

So I use templates not just because it makes it easier to impose a consistant look and feel on a web site, but because it makes almost all of my Perl work easier.

--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me


In reply to Re: Why use Templates at all? by davorg
in thread Why use Templates at all? by extremely

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.