[Zope] expression in a tree tag?

Evan Simpson evan@4-am.com
Tue, 11 Jan 2000 17:46:45 -0600


Guy Davis wrote:

> <dtml-tree expr="_.string.split(URL0,'/')[4]" ...
> but this doesn't seem to actually evaluate the method call as I got a
> name error for _.  How can I have the dtml-tree tag evaluate that
> expression and get 'ProjectName'?  Thanks again.

Well, you should be able to do <dtml-tree
expr="_[_.string.split(URL0,'/')[4]]">, but that's a bit roundabout when
what you probably want is
<dtml-tree expr="PARENTS[-3]"> (that is, the third parent object from the
top, counting the root).

Cheers,

Evan @ 4-am