I tried to follow the example of a let tag in "DTML User's Guide". I tried made a DTML Method with the following code: <dtml-in "1,2,3,4"> <dtml-let num=sequence-item index=sequence-index result="num*index" <dtml-var num> * <dtml-var index> = <dtml-var result> </dtml-let> </dtml-in> When I click on Change, I have the message: invalid parameter: " Similarly, I tried the example in the HOW-TO: let Tag: <dtml-let name="bob"> relation="uncle" <dtml-var name> is your <dtml-var relation> </dtml-let> I can click on Change, the problem is when I go the URL of the method, I get message: Zope Error Zope has encountered an error while publishing this resource. Error Type: NameError Error Value: bob ...What's wrong?
On Wed, 15 Sep 1999 picasso@videotron.ca wrote:
I tried to follow the example of a let tag in "DTML User's Guide". I tried made a DTML Method with the following code:
<dtml-in "1,2,3,4"> Well, try this: <dtml-in "[1,2,3,4]"> <dtml-let num=sequence-item index=sequence-index result="num*index" ^---- >
<dtml-var num> * <dtml-var index> = <dtml-var result> </dtml-let> </dtml-in>
When I click on Change, I have the message: invalid parameter: "
Similarly, I tried the example in the HOW-TO: let Tag:
<dtml-let name="bob"> relation="uncle" Again: You forgot the closing >. <dtml-var name> is your <dtml-var relation> </dtml-let> Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +43/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
----- Original Message ----- From: Andreas Kostyrka <andreas@mtg.co.at> [points out missing closing '>'s] Also, the error on the second one suggests that you should not use 'name' in a Let tag. 'name' is problematic for several tags; for instance you would need to write <dtml-var name=name> rather than <dtml-var name>. Try using a different variable.
Also, the error on the second one suggests that you should not use 'name' in a Let tag. 'name' is problematic for several tags; for instance you would need to write <dtml-var name=name> rather than <dtml-var name>. Try using a different variable.
Thanks a lot. I also tried: <dtml-let firstname="mick" relation="uncle"> <dtml-var firstname> is your <dtml-var relation> </dtml-let> Same result: Error Type: NameError Error Value: mick
Sorry about that, I answered without reading closely enough. You want "mick" and "uncle" to be string literals, don't you. The Let tag treats attributes the same way that Var does, so "mick" is actually a Python expression which tries to take the value of the variable 'mick'. You want to put single quotes inside the double quotes, thus: " 'mick' ". This should do what you want. ----- Original Message ----- From: <picasso@videotron.ca>
<dtml-let firstname="mick" relation="uncle"> <dtml-var firstname> is your <dtml-var relation> </dtml-let>
Same result:
Error Type: NameError Error Value: mick
Thanks you all, I really appreciate, your help and patience in answering my 'basic questions'.
The Let tag treats attributes the same way that Var does, so "mick" is actually a Python expression which tries to take the value of the variable 'mick'.
*************************** Oscar Picasso picasso@videotron.ca ***************************
At 11:20 am -0400 15/9/99, picasso@videotron.ca wrote:
I tried to follow the example of a let tag in "DTML User's Guide". I tried made a DTML Method with the following code:
<dtml-in "1,2,3,4"> <dtml-let num=sequence-item index=sequence-index result="num*index" <dtml-var num> * <dtml-var index> = <dtml-var result> </dtml-let> </dtml-in>
This works... <dtml-in "1,2,3,6,7"> <dtml-let num=sequence-item idx=sequence-index top="num*idx"> <dtml-var sequence-item>,<dtml-var top><br> </dtml-let> </dtml-in> o/p 1,0 2,2 3,6 6,18 7,28
When I click on Change, I have the message: invalid parameter: "
Similarly, I tried the example in the HOW-TO: let Tag:
<dtml-let name="bob"> relation="uncle" <dtml-var name> is your <dtml-var relation> </dtml-let>
I can click on Change, the problem is when I go the URL of the method, I get message:
Zope Error Zope has encountered an error while publishing this resource.
Error Type: NameError Error Value: bob
bob & uncle need quoting, otherwise the let tag thinks you're giving it another name to lookup, hence the NameError This works too... <dtml-let name="'bob'" relation="'uncle'"> <dtml-var name> is your <dtml-var relation> </dtml-let> o/p bob is your uncle Note Evans' comments about using 'name' as a variable name however... hth Tone ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
participants (4)
-
Andreas Kostyrka -
Evan Simpson -
picasso@videotron.ca -
Tony McDonald