[Zope] Trees of search results

Rik Hoekstra rik.hoekstra@inghist.nl
Fri, 28 Apr 2000 12:40:16 +0200


Jason Spisak wrote:
> 
> Zopists,
> 
> Is there any way to get a tree tag to render from search results so that
> you can "turn down" the *result* and see it's children?
> 
> <dtml-in "objectValues()" size=10 skip_unauthorized reverse>
>  <dtml-let a=sequence-item>
>   <dtml-tree expr="a.PARENTS[1]">
>    <dtml-var id>
>   </dtml-tree>
>  </dtml-let>
> </dtml-in>
> 
> The above code doesn't work.  I'll bet it's trivial but I'm missing it.

If it's trivial, I couldn't tell. What won't work is adding more than
one tree, which you do by iterating the objectValues. Perhaps you could
assign the objectValues parents to a list (in the same way you now try
to tree them) and take that as an input for your tree?
Like so (UNtested):

<dtml-call "REQUEST.set('plist', [])">
<dtml-in "objectValues()" size=10 skip_unauthorized reverse>
 <dtml-let a=sequence-item>
  <dtml-call "plist.append(a.PARENTS[1])">
 </dtml-let>
</dtml-in>
<dtml-tree plist>
  etc.




BTW, are you acquainted with Anthony Baxter's How-To: Some Neat Tricks
with dtml-tree. It might give you some ideas. URL:
http://www.zope.org/Members/anthony/tree-coding-tricks


Rik