Hello ALL, According to documentation zope.org this should work: <dtml-let foo="blah"> <dtml-var foo> </dtml-let> but it does not, I get an error Error Type: NameError Error Value: blah It seems that it considers blah as a variable, so how could I tell zope that it's just a string? Best regards, Ainis mailto:ainis@mindless.com
Change your code to <dtml-let foo="'blah'"> <dtml-var foo> </dtml-let> Notice the single quotes within the double quotes, the let tag takes a string and does a sort of eval on it, this means that strings have to be quoted within the string. If you see what I mean ;?) Phil phil@philh.org -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Ainis Sent: Wednesday, September 29, 1999 7:36 AM To: zope@zope.org Subject: [Zope] problem with let tag Hello ALL, According to documentation zope.org this should work: <dtml-let foo="blah"> <dtml-var foo> </dtml-let> but it does not, I get an error Error Type: NameError Error Value: blah It seems that it considers blah as a variable, so how could I tell zope that it's just a string? Best regards, Ainis mailto:ainis@mindless.com _______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope (To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
At 08:35 29/09/99 , Ainis wrote:
Hello ALL,
According to documentation zope.org this should work: <dtml-let foo="blah"> <dtml-var foo> </dtml-let>
but it does not, I get an error Error Type: NameError Error Value: blah
It seems that it considers blah as a variable, so how could I tell zope that it's just a string?
It indeed sees blah as a var, because everything between the double quotes is a DTML expression (based on python). To let the parser know it is a string literal, you'll have to place it in quotes (single or double). Double quotes will mess up your DTML, so you use single quotes: <dtml-let foo="'blah'"> <dtml-var foo> </dtml-let> -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
participants (3)
-
Ainis -
Martijn Pieters -
Phil Harris