I've been following, and enjoying, kiat's recent posts because as a web designer I feel we are on parallel journeys in learning how to use Perl to support our development. Thanks kiat for your unabashed posts.

Web development in our shop is done as a team effort. We have the account folks to cast the vision; graphic designers to develop the look, feel, navigation; and then a programmer or two to make it work--connecting the web-based content editors with MySQL and Perl, similar to kiat's scenario.

Before we discovered HTML::Template (H::T)*, all our output was heredocs. This drove the the designers crazy--to make even a small change they felt they had to rely on the programmers (designers can get nervous around Perl). In fact, it frustrated everyone because it took two bodies to make the revision--inefficient to say the least.

H::T changed that, of course, because the subtle design changes could be made without bothering the rest of the team. But not completely, because we were still including too much HTML in the Perl scripts. However, as we have moved more HTML back to the templates docs by using, as barrd points out, the H::T conditionals, we are giving more control back to the designers--all the HTML is accessible to their layout programs (Dreamweaver or GoLive).

All that to say: the rule of thumb in our shop is to distill our code down to the point where we are using every possible convention of H::T to keep as much HTML in the .tmpl doc as possible. So, anytime something needs to be displayed in the browser window, whether a full-fledged content page or a simple error message, an .tmpl doc is doing the work. The look and brand of the site is maintained. Bottomline: keep code and HTML as separate as possible.

*I realize there are other templating systems, we just happened to get hooked on H::T

—Brad
"A little yeast leavens the whole dough."

In reply to Re: Template::HTML - what's the rule of thumb? by bradcathey
in thread HTML::Template - what's the rule of thumb? by kiat

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.