[ZPT] ZPT object called with keywords and pick them up

Peter Bengtsson mail@peterbe.com
Wed, 20 Jun 2001 14:38:08 +0200


> In your script:
>
> return container.mytemplate(answer=42)
>
> In your template:
>
> The answer is <span tal:replace="options/answer"/>.

Thanks that solved it!
I also had to use the 'structure' thing too to make it return the rendered
result of "answer".

Cheers! That saved us some time.

Peter

PS. I love the community. Go ZOPE!

>
>
> -- Wade Leftwich
>
> --------------------------------------------------------------------
>
>
> > From: "Peter Bengtsson" <mail@peterbe.com>
> > To: <zpt@zope.org>
> > Date: Tue, 19 Jun 2001 15:04:20 +0200
> > Subject: [ZPT] ZPT object called with keywords and pick them up
> >
> > When calling a DTML * from Python you pass the 'self', REQUEST, and a
free
> > keyword argument and the DTML* can pick it up.
> >
> > <for example>
> > displayname.__call__(self, parent, REQUEST, RESPONSE, name='Peter')
> > </for example>
> >
> > That's in Python. To do the same in DTML would be:
> > <dtml-let name="'Peter'">
> >   <dtml-var displayname>
> > </dtml-let>
> >
> > How is it with ZPT?
> >
>
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://lists.zope.org/mailman/listinfo/zpt