Hi, Thanks, you knew what I was getting at and answered it. Woo !
Jeff. On 7/20/06, Cees Hek <[EMAIL PROTECTED]> wrote:
On 7/20/06, Jeff MacDonald <[EMAIL PROTECTED]> wrote: > So, what I'm trying to do is : > > 1: turn off my PRE/POST processing and parse an email template and > send it out to the user. > 2: turn the PRE/POST back to what they were and forward the runmode along. > > Here's whats actually happening. > > 1: The mail get's sent as I would expect, without the PRE/POST processing. > 2: When the run mode get's forwarded, signup_complete renders without > the PRE / POST processing. > > Idea's ? The TT object is only created once, and is then cached for the duration of the cgiapp object (if you configured it with $self->tt_config), or for the duration of the process (if you configured it with __PACKAGE__->tt_config). So changing the configuration in between calls to tt_process will do nothing, since the second call will just use the prevously created TT object. My guess is that you use the PRE/POST hooks to add a common header and footer to your pages (I use the WRAPPER config option for the same thing). However, my wrapper template has some extra logic in it that checks to see if a 'no_wrapper' variable has been set, and will not output anything if it is true. Here is what my wrapper.tmpl file looks like: [% IF no_wrapper %] [% content %] [% ELSE %] <!-- start header --> [% PROCESS header.tmpl %] <!-- end header --> [% content %] <!-- start footer --> [% PROCESS footer.tmpl %] <!-- end footer --> [% END %] So when I want to process a template that should not have the common header and footer, I pass in a no_wrapper parameter to my template and set it to 1. Another way to do the same thing is by changing the template include path. You can unshift an extra path to the front of your include path that contains an empty version of your PRE and POST templates. Those empty files will then override your regular files. If you are doing something different. let me know, but generally you can do what you need with a simple test in the template, instead of creating a new TT object with a new config. Cheers, Cees
-- Unless otherwise indicated, anything I write is either garnered from experience or pulled out of my ass, depending on situational needs.. Jeff MacDonald --------------------------------------------------------------------- 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]
