I could think of more ways you can achieve this; a quick idea is to
provide a subroutine reference to INCLUDE_PATH, i.e.:

new Template(...
    INCLUDE_PATH => [ '/templates/shared/if/you/want',
                      sub {
                        my $r = Apache->request;
                        my %args = $r->args;
                        my $skin = $args{skin} || 'default';
                        return [ "/templates/skins/$skin" ];
                      }
                    ]
]);

Your sub will be called any time a template is requested, no matter if
the object is a singleton.  The tricky part here is retrieving the query
args.  I hope the above works (disclaimer: didn't check), it's relying
on the fact that you can access the current request obj. using
Apache->request.  This is probably asking for trouble wrt
apache2/mod_perl2 (I'm happy enough with 1.3.x for the forseable
future :p).

On Sat, 2007-10-06 at 11:34 +0100, Anthony Gardner wrote:
> I've looked through the docs, more than a year of mail archives and googled 
> but was unable to find an answer.

Try "man Template::Manual::Config" as well. ;-)

Cheers,
-Mihai


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to