[Zope] Re: How to pass parameters to a DTML Method from within another

Abigail Montero abimontero@apexmail.com
Mon, 25 Oct 1999 01:18:26 -0800


Having asked the exact same question just a few days ago,
I'm forwarding what Kevin (thanks, kevin) wrote back
to answer my question:

kid@kendermedia.com Said: 
> -----Original Message-----
> From: Abigail Montero <abimontero@apexmail.com>
> To: zope@zope.org <zope@zope.org>
> Date: Friday, October 22, 1999 9:24 PM
> Subject: [Zope] DTML Namespace confusion
> 
> 
> >But what I would really like to do is this:
> >
> >   <dtml-if "some_condition">
> >      <dtml-var  "render_item(_,_.None,REQUEST,input_var1='value1')">
> >   <dtml-else>
> >      <dtml-var   "render_item(_,_.None,REQUEST,input_var1='value2')">
> >    </dtml-if>
> 
> You're very close. Michel Pelletier wrote a message a few weeks 
> back that
> explained things nicely. Basically, the first parameter is the 
> "target"
> object (not sure if that's the right word), and the second 
> parameter is the
> namespace.
> 
> <dtml-if "some_condition">
>  <dtml-var "render_item(_.None, _, input_var1='value1')">
> <dtml-else>
>  <dtml-var "render_item(_.None, _, input_var1='value2')">
> </dtml-if>
> 
> Should do what you're looking for. Note that you don't need to 
> pass REQUEST
> in, because it is a part of the namespace.
> 
> Kevin

Note: this really should be added to ZDP's FAQ!


HTH.

Abigail
____________________________________
Email services provided by ApexMail
http://www.apexmail.com