That's perfect. Thanks! Sorry I didn't realize that from the docs. I was stupidly assuming some kind of problematic name collisions would happen.

-Ashley

On Tuesday, January 10, 2006, at 02:43  PM, Jason Galea wrote:

Hi Ashley,

you can do this via your template config.

my $template = Template->new({
        INCLUDE_PATH => [ '/home/usr/html',
                          '/usr/local/html' ],
    });

Put the users' directory first, followed by the default directory. TT will search the directories in order giving the effect you are after.

cheers,

J


apv wrote:
I am working on an application where I want the user to be able to supply their own templates which will take precedence over the default ones. It seems like there might be a way to do this in the include path ordering or something but all I can up with is something like this:
[% TRY %]
[% INCLUDE user_dir/template_xyz %]
[% CATCH %]
[% INCLUDE default_dir/template_xyz %]
[% END %]
That seems fine for a single case but I want the user to be able to override pretty much every template (without having to do so; meaning the defaults are largely going to remain and thus we can't simply choose one entire set or the other).
Any great ideas?
-Ashley
_______________________________________________
templates mailing list
templates@template-toolkit.org
http://lists.template-toolkit.org/mailman/listinfo/templates




_______________________________________________
templates mailing list
templates@template-toolkit.org
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to