I am using HTML::Template in a webapp where I have a single template with a set of style sheets that gives the entire site its look and feel. I have form generation and validation code based on CGI::FormBuilder for some 200 forms with corresponding templates for each form.

What I would like to do is be able to have the <TMPL_INCLUDE 'filename.tmpl'> be controllable so that I can specify which template is to be included in the content <div> before the template is passed to CGI::FormBuilder.

Thinking about the problem I could:

  1. Use another templating system to put the include name into the page template.
  2. Leave the INCLUDE name the same, but rename the form template before the template is passed (or maybe copy it and then it is over-written when the next template is built)

But neither of these methods is safe in the mod_perl context. So I could:

I feel I am getting a little over my head here. If need be I can create a special module to handle this, but I am not sure how it would be best to go about it.

jdtoronto


In reply to HTML::Template question. by jdtoronto

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.