[Zope] TREE tag - not showing Folderish objects that contain no sub-objects

Kevin Howe khowe@performance-net.com
Sat, 13 Jan 2001 17:11:57 -0400


I currently have a TREE tag as follows:

  <dtml-tree expr="PARENTS[-1]" branches_expr="objectValues()" sort=id>

which basically says:

  "Display objects which can contain sub-objects"

such as Folders, Folderish Products, ZClassed based on ObjectManager, etc.

What I would like to do is display these objects, but ONLY IF they currently
contain some objects, so that if an object does not contain any subobjects
at the moment, it is not displayed. Something like the following:

  <dtml-tree expr="PARENTS[-1]" branches_expr="_.len( objectValues() ) > 0"
sort=id>

Unfortuntately the above doesn't seem to work (can Python's len() function
be called from DTML?).

Does anyone know what expression might do what I am looking for?

Kevin