I posted this to the Template Toolkit list, but that list dosn't seem very active and I need an answer yesterday, so:

I wish to reuse various templates in toto between different URLs but allow different means of generating the information I fill the template with depending on the uri.

So far, I've tried using TT2PluginBase and TT2ServiceModule directives inside Location blocks inside my apache configuration file without success. For example, with TT2PluginBase I'm getting this error:

Syntax error on line 27 of /home/ceverett/apache/conf/physemp.affiliate.loc.conf:
TT2PluginBase not allowed here

using this conf snippet:

TT2Params all TT2Headers size TT2Trim On <Location /affiliate/report/> Options ExecCGI SetHandler perl-script AuthType Physemp::Auth AuthName Affiliate TT2PluginBase Physemp::Template::Plugin::User # line 27 PerlHandler Apache::Template </Location> <Location /account_exec/report/> Options ExecCGI SetHandler perl-script AuthType Physemp::Auth AuthName Affiliate TT2PluginBase Physemp::Template::Plugin::Admin PerlHandler Apache::Template </Location>
I get the same type error using the TT2ServiceModule directive inside a Location block.

I'm using TT 2.10, Apache::Template 0.06, Apache 1.3.27 and mod_perl 1.28.

Is there a relatively straightforward way of modifying Apache::Template behavior per directory/location block?

Also, the Apache::Template docs don't say where specific configuration directives are allowed/forbidden. Ought I assume that all TT2* directives are forbidden inside Directory/Location blocks?


In reply to Apache::Template perl directory configuration by cleverett

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.