Hi group,

I have a problem with AnyTemplate's Multiple Named Template
Configurations under a mod_perl environment. Following the convention in
AnyTemplate POD, I have the following in cgiapp_init():

$obj->template('no_wrapper')->config( # for templates not requiring
wrapper
  type => 'TemplateToolkit',
  include_paths => [
    $tmpl_path, # var declared earlier
  ],
  TemplateToolkit => {
    TAG_STYLE => 'asp',
    INTERPOLATE => '1',
  },
);

$obj->template->config( # default AnyTemplate config
  type => 'TemplateToolkit',
  include_paths => [
    $tmpl_path,
  ],
  TemplateToolkit => {
    TAG_STYLE => 'asp',
    INTERPOLATE => '1',
    WRAPPER => 'wrapper.tmpl',
  },
);

The only difference is the absence of WRAPPER => 'wrapper.tmpl' in
$obj->template('no_wrapper')->config. In those run-modes where I do not
want to have the output wrapped I call the template like so:
$obj->template('no_wrapper')->fill($rec);

This works in a CGI environment, but not when run via mod_perl registry
or handler - I get the same as if I had called
$obj->template->fill($rec), ie content is wrapped. I could probably get
round it by using something like $obj->template('default')->config, but
only a small minority of run modes need the non-wrapper config, so it is
a lot of extra 'noise'.

Using CAP:AnyTemplate v0.15 on PC running Apache/2.0.52 (Win32)
PHP/4.3.10 mod_ssl/2.0.52 OpenSSL/0.9.7e mod_perl/2.0.1 Perl/v5.8.7
-- 
Richard Jones
Leeds, UK
mailto:[EMAIL PROTECTED]

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to