Hi dragonchild,

Unfortunately there are much deeper problems as far as dynamic includes are concerned. You could go the way of including a filter, however, this won't work the way you expect it to if you cache the parsed template (the filter doesn't get processed on cached or file_cached templates). The most common solution to this problem is to go ahead and process one of the inner templates and include it as a parameter to the outer. If you've been following the html-template mailing list recently, there's been a good amount of talk concerning changes Sam Tregar hopes to implement in version 3.0. It seems that the changes would allow templates to be included dynamically if not directly through an included method then at least by changing the template's parse structure itself.

Of course, I know of a couple of projects currently being worked upon to implement some new features on top of HTML::Template, however, I'm unable to recall any of them at this moment.


In reply to Re: HTML::Template .... misfeature? by !1
in thread HTML::Template .... misfeature? by dragonchild

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.