[Zope] dtml-var syntax - am i being dumb ?
Carlson, Christopher W.
Christopher.W.Carlson@ct.sgcna.com
Wed, 23 Feb 2000 12:36:32 -0600
Being a newbie and all, I hate to pipe in like this. However, the DTML
manual reads:
"Because of the /name/ attribute's frequent usage, there exists a short-hand
version of the /name/ attribute in which the attribute name is omitted:
Hello <dtml-var input_name capitalize>!
When using the short-hand form of the /name/ attribute, the value is the
first attribute in the tag and is not enclosed in quotation marks."
I don't have any insight into the timesit() issue, though. :)
--- Chris
-----Original Message-----
From: Matt Goodall [mailto:mgg@isotek.co.uk]
Sent: Wednesday, February 23, 2000 11:21 AM
To: Richard Moon
Cc: zope@zope.org
Subject: Re: [Zope] dtml-var syntax - am i being dumb ?
Richard Moon wrote:
>
> Please stop me going mad.
>
> I created two python method. The first , called 'know_nothing' takes no
> parameters but returns the string "I know nothing",
> the second, called 'timesit" takes two parameters, multiplies them and
> returns the result. When I come to use them from within
> a DTML document why do I have to say
> <dtml-var "timesit(1,2)">
> but
> <dtml-var know_nothing>
>
> I assume the top one is short for
> <dtml-var expr="timesit(1,2)">
> whereas the second is short for
> <dtml-var name=know_nothing> (or even <dtml-var name="know_nothing"> since
> that seems to work as well)
>
> (am I right ?)
>
> and I think I understand that the name attribute is actually a function
> call with no parameters - right ?
>
> but why does
> <dtml-var expr="know_nothing" not return anything to the calling object ?
>
> Just when you think you are getting the hang of it :-)
I *think* that
<dtml-var know_nothing>
is actually equivalent to
<dtml-var expr="know_nothing()">
however I can't test this at the moment so I may be completely wrong
:-).
/Matt
_______________________________________________
Zope maillist - Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )