Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Can a Template Toolkit template know if it has been PROCESSed or INCLUDEd?

by petdance (Parson)
on Sep 25, 2014 at 16:29 UTC ( [id://1102004]=note: print w/replies, xml ) Need Help??


in reply to Can a Template Toolkit template know if it has been PROCESSed or INCLUDEd?

Andy Wardley just wrote this reply on the TT mailing list:
Nope, there's nothing I can think of that will allow you to determine that from within the template. One work-around would be to INCLUDE a local BLOCK inside the template.
[% INCLUDE my_local_block %] [% BLOCK my_local_block %] .... [% END %]
It's a bit clumsy but it does at least ensure that the template markup in the BLOCK will always be protected by an INCLUDE, even if the template is loaded by a PROCESS.

xoxo,
Andy

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1102004]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2024-03-28 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found