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.
Perrin Harkins wrote: > No, you don't, you just need to put all of the directories to be > searched, in the correct order, into your include path.
and Chris wrote:
Yes I did see that, but in order for it to be of use I have to go back and change a bunch of code,
I was getting confused about what works and what doesn't in this discussion, so I wrote a little test. It all 'Just Works' as Perrin suggested, so I'd definitely go that way if it was me.
Cheers, Dave
class-instance-test.pl ---------------------- #!/usr/bin/perl use strict; use warnings;
use Template;
my %tt_data = ( variable => 'variable\'s value' );
my $tt = Template->new( INCLUDE_PATH => 'instance:class', OUTPUT_PATH => 'html' );
$tt->process('index.tt', \%tt_data, 'index.html'); $tt->process('index2.tt', \%tt_data, 'index2.html');
class/index.tt -------------- This is the CLASS index Include a template that's only present in the instance directory: [% INCLUDE instance.tt %] one that's present in both directories [% INCLUDE override.tt %] and one that's only in the class directory [% INCLUDE class.tt %] Thats all, folks!
class/index2.tt --------------- This is the CLASS index2 TWO (only in class directory) Include a template that's only present in the instance directory: [% INCLUDE instance.tt %] one that's present in both directories [% INCLUDE override.tt %] and one that's only in the class directory [% INCLUDE class.tt %] Thats all, folks!
class/class.tt -------------- This is the class template in the class directory.
class/override.tt ----------------- This is the override template in the class directory.
instance/index.tt ----------------- This is the INSTANCE index Include a template that's only present in the instance directory: [% INCLUDE instance.tt %] one that's present in both directories [% INCLUDE override.tt %] and one that's only in the class directory [% INCLUDE class.tt %] Thats all, folks!
instance/instance.tt -------------------- This is the instance template in the instance directory.
instance/override.tt -------------------- This is the override template in the instance directory.
_______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates