[Zope] Arguments to DTML methods

J C Lawrence claw@cp.net
Fri, 14 Jan 2000 13:22:26 -0800


On Fri, 14 Jan 2000 16:24:48 -0500 
Michel Pelletier <michel@digicool.com> wrote:

>> From: coder@kanga.nu
>> This is pretty hokey, especially when I invoke "custom_segment"
>> half a dozen times in a single template or method.  Is there a
>> better way to fake passing arguments to a DTML method?

> You don't need to fake it, because all DTML objects _can_ be
> passed arguments.

Ahh.  Is this buried in the DTML guide or am I going blind?  I read
that thing three times last night looking...

> <dtml-var "aMethod(aMappingObject, aClient, arg1, arg2...)">

Excellent.

> They rest are all keyword arguments.  This is the most common
> usage:

> <dtml-var "aMethod(_, _.None, bob='uncle')">

> Note the double quotes, they are important.

Thanks.

I just got bit on that point last night in using a dtml-let to
assign a string to a variable.  It wasn't obvious from the DTML
guide that I needed to nest single quotes in a double quotes ala:

  <dtml-let variable="'text'">

-- 
J C Lawrence                              Internet: claw@kanga.nu
----------(*)                            Internet: coder@kanga.nu
...Honorary Member of Clan McFud -- Teamer's Avenging Monolith...