[Zope] Re: [Re: [Zope] can dtml methods take arguments ?]

happyrhino@usa.net happyrhino@usa.net
29 Aug 99 11:04:31 MDT


Andreas Kostyrka <andreas@mtg.co.at> wrote:
On 29 Aug 1999 happyrhino@usa.net wrote:

>> The name "method" suggests that DTML methods should be able
>> to take arguments much like ZSQL methods can. But for the 
>> life of me I can't find where these are added. 
>
>Well, just use them ;)

Sorry Andreas, I'm feeling a bit stupid here. You say to just 
use them so I've been trying variations without any luck.

Consider a DTML method "dtmNavigation" which contains the following =
<dtml-with "CommonElements">
<TABLE WIDTH=<dtml-var mywidth>>
<TR>
<!-- ommitted for clarity -->


So, I'd like to be able to call it with varying values of 'mywidth'.
I've tried to call dtmNavigation with arguments from a DTML document
like this =
<dtml-var "dtmNavigation(mywidth=120)"> 

But that produces a very strange result. I then get the following
error =

Error Type: NameError
Error Value: CommonElements

How on earth did that crop up ? And how could the DTML method be written
so that if no arguments were passed, a default value is used  just
like standard python functions and methods.
ie. def functionname( arg1=defaultvalue1, arg2=defaultvalue2)

Or have I  totally misunderstood what you meant ?

Henry

By the way, was there any decision taken on a syntax change from
<dtml-tag >  to <z-tag > or <dt-tag > because I have to agree
that the mere presence of the 'dtml' in the tag makes it much
harder to read than the Cold Fusion syntax.

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1