[Templates] PRE_PROCESS question

[prev] [thread] [next] [Date index for 2005/05/20]

From: Bruce McKenzie
Subject: [Templates] PRE_PROCESS question
Date: 13:00 on 20 May 2005
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
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] PRE_PROCESS question
Bruce McKenzie 13:00 on 20 May 2005

Re: [Templates] PRE_PROCESS question
Mark Mills 13:20 on 20 May 2005

Re: [Templates] PRE_PROCESS question
Cees Hek 15:01 on 20 May 2005

Generated at 15:56 on 25 May 2005 by mariachi v0.52