[Zope] images in trees.

Ethan Fremen mindlace@majordomo.net
Fri, 24 Sep 1999 11:00:25 +0100


Martijn Pieters wrote:
> On DTML Documents, id is a method. You are comparing a method object to a
> string, so this will always turn out to be false. Test for id() == 'fozcoa'.

Thanks, Martijn, that works.
however, if I now run this it crashes:
<dtml-tree content branches_expr="objectValues(['Folder', 'DTML
Document'])" sort=order >
<dtml-if expr="meta_type == 'Folder'">
	<dtml-var title_or_id>
<dtml-else>
	<dtml-if expr="id() == 'cnart'"><dtml-var cnartgif></dtml-if>

But I know it works because if I replace <dtml-var cnartgif> with boo
the boo shows up.  The image cnartgif is in the content folder. 
Here's the last 3 items in the traceback:

  File /usr/local/src/Zope-2.0.0-src/lib/python/TreeDisplay/TreeTag.py,
line 250, in tpRender
      (Object: ElementWithAttributes)
    File
/usr/local/src/Zope-2.0.0-src/lib/python/TreeDisplay/TreeTag.py, line
491, in tpRenderTABLE
      (Object: ElementWithAttributes)
      (Info: (['AAAAAAAAALc=', []], {'childless_decoration': '', 'id':
'tpId', 'branches_expr': <method Eval.eval of Eval instance at 85bc0e8>,
'sort': 'order', 'url': 'tpURL', 'name': 'content', '': 'content'},
[['AAAAAAAAALc=', []]], [['AAAAAAAAALc=', []]]))
    File
/usr/local/src/Zope-2.0.0-src/lib/python/TreeDisplay/TreeTag.py, line
408, in tpRenderTABLE
      (Object: cnart)
  AttributeError: __call__

I have no idea what a 'childless decoration' is.
-- 
~mindlace