Hello.
I'm trying to learn to use TTK and CGI::Application TTK plugin.
My current bafflement is with the PRE_PROCESS process.
I have a bunch of macros in a file called "macros.tt2"
In the past, I have simply put at the top of each page:
{% PROCESS macros.tt2 %]and the macros become available. I could live this, but "PRE_PROCESSING" sounds so much more prepossessing :-)
I've tried the following to no avail:
[in WebApp.pm]
$self->tt_process( 'test.tt2', { q => $q, t => $t1 , PRE_PROCESS => 'macros.tt2'} ); # the first two vars arrive as expected, but no macros
[or]
sub tt_pre_process {
my $self = shift;
my $template = shift;
my $params = shift;
$params->{PRE_PROCESS} = 'macros.tt2';
#the name shows up in params, but no macros are processed
return;
}[or]
sub cgiapp_init {
my $self = shift;
$self->tt_config( TEMPLATE_OPTIONS => $Config_TT::config),
$self->tt_params(%$Config_TT::subroutines);
$self->tt_params(username => $username);
$self->tt_params(PRE_PROCESS => 'macros.tt2');
# params are ok, but no macros are processed
}These subs all work, except for the PRE_PROCESS part.
What am I not understanding about preprocessing?
Thx,
Bruce
_______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates
