[Zope] Arguments to DTML methods

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


> -----Original Message-----
> From: coder@kanga.nu [mailto: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.

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

'aMappingObject' is a mapping containing the current 'namespace', or the
namespace you want this method to use.  This is often '_' (the current
DTML namespace)

'aClient' is an object you want to provide the namespace for this
method.  This is often '_.None' (no client object)

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.

-Michel