Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Overriding Apache::Template postprocessing directive within a specific TT2 file

by jbullock35 (Hermit)
on Dec 15, 2008 at 23:59 UTC ( #730538=perlquestion: print w/ replies, xml ) Need Help??
jbullock35 has asked for the wisdom of the Perl Monks concerning the following question:

I'm working on a server that is running Template Toolkit 2.14 and Apache::Template. The Apache .conf files, which I cannot edit, include the directive

    TT2PostProcess FOOTER

which appends the file FOOTER to every TT2 file that is served by Apache.

This is almost always what I want. But there is one particular TT2 file, special.tt2, for which I don't want FOOTER to be appended. Can I place a command in special.tt2 to ensure that FOOTER won't be appended?

Comment on Overriding Apache::Template postprocessing directive within a specific TT2 file
Select or Download Code
Re: Overriding Apache::Template postprocessing directive within a specific TT2 file
by Your Mother (Canon) on Dec 16, 2008 at 00:57 UTC

    I think you can do it this way, not sure if it's the best. Untested and I've never tried to do this but it might be right. The trick is you have to put it in the footer template file, at the very top.

    [% RETURN IF template.name EQ "special.tt2" %]

    Something like this is okay if it's a single hack but it tends to point to an underlying design flaw. Probably it would be better to assign the footer based on some datapoint from inside the controller code rather than tacking it onto everything that comes out of the executable.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://730538]
Approved by Tanktalus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2014-12-29 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (188 votes), past polls