logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: PROCESS/INCLUDE on relative files: msg#00059

Subject: Re: PROCESS/INCLUDE on relative files
Chris Ochs wrote:
In the meantime, I just populate a template variable with the path of the
current directory so my PROCESS/INCLUDE statements look like this:

[% PROCESS "$params.dir/header.html" %]

Easy enough, but it's more intuitive without the params.dir bit.

Now what I want is to have the system look for files included via
PROCESS/INCLUDE directives in the templates directory if they dont' exist in
the catalog.  I think I will have to hack on TT a bit to accomplish that
though.

No, you don't, you just need to put all of the directories to be searched, in the correct order, into your include path. People seem to be constantly confused about this, so I think maybe it should be in giant red blinking letters at the top of the Template docs: you can change the include path. You can change it on every request. You can change it hundreds of times, during a request if you feel like it. It is dynamic.

Read this for more information:
http://www.template-toolkit.org/docs/plain/Manual/Config.html#Template_Files_and_Blocks

If you want more examples, you'll find hundreds of discussions about this in the mailing list archives. Feel free to ask if it doesn't make sense to you.

- Perrin


<Prev in Thread] Current Thread [Next in Thread>