So, I have this in my gd.png file:

[% META nowrap=1 %]
[%-
        USE gdc = GD.Constants;
        USE im  = GD.Image(200,100);
        black = im.colorAllocate(0  ,0,  0);
        red   = im.colorAllocate(255,0,  0);
        r = im.string(gdc.gdLargeFont, 10, 10, "Large Red Text", red);
        im.png;  
-%]

And this in the "process" file:

[%- 
        IF template.nowrap;
        PROCESS $template | trim;
        RETURN;
    END;
        
        WRAPPER page.tt2; PROCESS $template; END
-%]

Now, this works with tpage, but for some reason, ttree winds up creating
a corrupt image file.  I checked, and ttree is not wrapping the file,
but the contents are NG.  Ideas?

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]] On Behalf Of 
> Andy Wardley
> Sent: Monday, February 11, 2002 4:20 AM
> To: David B. Bitton
> Cc: 'Craig Barratt'; [EMAIL PROTECTED]
> Subject: Re: [Templates] GD
> 
> 
> On Mon, Feb 11, 2002 at 12:04:22AM -0500, David B. Bitton wrote:
> > I just implemented this and one problem, all items in the tree are 
> > being "process"'ed with a wrapper, so ttree wrapped the png file.  
> > Hmm, back to the redirect filter.
> 
> You can do something like this in your template-which-needs-no-wrapper
> 
>   [% META naked=1 %]
> 
>   ...template content...
> 
> and then in your PROCESS template:
> 
>  [%-
>     # don't enclose page in wrapper if 'naked' META item is set
>     # (e.g. for css and javascript files)
>     IF template.naked;
>         PROCESS $template | trim;
>         RETURN;
>     END;
> 
>     # ...any other stuff...
> 
>     # process the page template and wrap it up in a nice interface
>     PROCESS $template WRAPPER layout/main
> -%]
> 
> HTH
> A
> 
> 
> _______________________________________________
> templates mailing list
> [EMAIL PROTECTED] 
> http://www.template-> toolkit.org/mailman/listinfo/templates
> 



Reply via email to