[Zope] DTML-TREE

Rik Hoekstra rik.hoekstra@inghist.nl
Wed, 19 Apr 2000 15:29:39 +0200


Tom Deprez wrote:
> 
> ><dtml-if myobject>
> > <dtml-tree myobject>
> >  ...
> > </dtml-tree>
> ><dtml-else>
> > ...put your else stuff here...
> ></dtml-if>
> 
> I don't define myobject. My tree searches certain classes. :
> 
> <dtml-tree branches_expr="objectValues['MyClass']">
> </dtml-tree>
> 
> This code is defined in the index_html of a container class.
> 
> So in order to use the 'if' statement, I would need a way to say : 'if a
> class exists of this type then, otherwise do..'. How can I handle this?
> 

Tom, 

I think you need something like (untested)

<dtml-if "_.len(objectValues(['MyClass']))>0">
  <dtml-tree objectValues(['MyClass'])>
  </dtml-tree>
</dtml-else>
  blablablablabla
</dtml-if>

Rik