More generally, support for augmenting the Template Toolkit template
path list to allow for per-vhost template paths.
For example, a 3-tier consortium could do something like this:
<VirtualHost ...>
[...]
PerlAddVar OILSTemplatePath "/openils/var/templates_branch_abc"
PerlAddVar OILSTemplatePath "/openils/var/templates_system_xyz"
PerlAddVar OILSTemplatePath "/openils/var/templates_shared"
</VirtualHost>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Options +ExecCGI
PerlSendHeader On
allow from all
+
+ # Example of overriding template paths. Template paths will be
+ # checked in order of their appearance here. The server will then
+ # go on to check template paths configured in oils_web.xml.
+ # PerlAddVar OILSTemplatePath "/openils/var/templates_BranchABC"
+ # PerlAddVar OILSTemplatePath "/openils/var/templates_SystemABC"
+
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
$ctx->{skin} = $cgi->cookie(OILS_HTTP_COOKIE_SKIN) || 'default';
$ctx->{theme} = $cgi->cookie(OILS_HTTP_COOKIE_THEME) || 'default';
+ # Any paths configured in Apache will be placed in front of
+ # any paths configured in the global oils_web.xml config.
+ my @template_paths = $r->dir_config->get('OILSTemplatePath');
+ unshift(@{$ctx->{template_paths}}, $_) for reverse @template_paths;
+ $r->log->debug("template paths => @{$ctx->{template_paths}}");
+
$ctx->{locale} =
$cgi->cookie(OILS_HTTP_COOKIE_LOCALE) ||
parse_accept_lang($r->headers_in->get('Accept-Language')) || 'en-US';