[Templates] Re: Template::Toolkit questions

Craig McLane mclanec@oxy.edu
Tue, 1 Aug 2000 11:22:46 -0700 (PDT)


On Tue, 1 Aug 2000, Andy Wardley wrote:
> Version 2 allows you to modify the INCLUDE_PATH at any time and have the
> Right Thing happen.  One solution might be to modify the INCLUDE_PATH
> for each request, effectively shifting the client_src/$client_name onto
> the front for each specific request.  I haven't tried this myself, so I
> can't show you any code, but there might be an elegant solution in there
> somewhere. 


The way I modify the INCLUDE_PATH on each request is like:

  # set the template include path for this request
  $tt->service->context->load_templates->[0]->include_path($include_path);

$include_path is an array ref of directories based on information specific
to each request.  I only work on the first element of load_templates
because I am not doing any tricky template provider magic when setting up
my template toolkit object.

Hope this helps,
Craig