[Zope] simple question about <!--#if expr="fieldname = 't'"-->

Donald Braman donald.braman@yale.edu
Mon, 19 Feb 2001 19:13:38 -0500


I'm having trouble making a simple text comparison (my very first in Zope).
I can get Zope to give me results for just <!--#var fieldname-->, but not
for <!--#if expr="fieldname = 't'"-->yes<!--else-->no<!--#/if>. I'm using
the following code:

<!--#in queryobjectname-->
<tr>
<font size="2" face="Arial Narrow">
<td><!--#if expr="fieldname = 't'"-->yes<!--else-->no<!--#/if></td>
</tr>
<!--#/in-->

Here's the error I get:

Zope Error
Zope has encountered an error while publishing this resource.

Error Type: SyntaxError
Error Value: invalid syntax

Traceback (innermost last):
  File /usr/local/zope/230/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /usr/local/zope/230/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /usr/local/zope/230/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
    (Object: index_html)
  File /usr/local/zope/230/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /usr/local/zope/230/lib/python/ZPublisher/mapply.py, line 160, in
mapply
    (Object: manage_edit)
  File /usr/local/zope/230/lib/python/ZPublisher/Publish.py, line 112, in
call_object
    (Object: manage_edit)
  File /usr/local/zope/230/lib/python/OFS/DTMLDocument.py, line 144, in
manage_edit
    (Object: index_html)
  File /usr/local/zope/230/lib/python/DocumentTemplate/DT_String.py, line
388, in munge
    (Object: index_html)
  File /usr/local/zope/230/lib/python/DocumentTemplate/DT_String.py, line
408, in cook
    (Object: index_html)
  File /usr/local/zope/230/lib/python/DocumentTemplate/DT_String.py, line
242, in parse
    (Object: index_html)
  File /usr/local/zope/230/lib/python/DocumentTemplate/DT_String.py, line
292, in parse_block
    (Object: index_html)
  File /usr/local/zope/230/lib/python/DocumentTemplate/DT_String.py, line
242, in parse
    (Object: index_html)
  File /usr/local/zope/230/lib/python/DocumentTemplate/DT_String.py, line
305, in parse_block
    (Object: index_html)
  File /usr/local/zope/230/lib/python/DocumentTemplate/DT_If.py, line 165,
in __init__
  File /usr/local/zope/230/lib/python/DocumentTemplate/DT_Util.py, line 386,
in name_param
    (Info: ({'expr': "fieldname = 't'"}, 'if', 1, 'name'))
  File /usr/local/zope/230/lib/python/DocumentTemplate/VSEval.py, line 166,
in __init__
    (Object: fieldname = 't')
SyntaxError: (see above)