Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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?

Replies are listed 'Best First'.
Re: Overriding Apache::Template postprocessing directive within a specific TT2 file
by Your Mother (Chancellor) 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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2016-12-08 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (134 votes). Check out past polls.