[Zope-CMF] Problems with tree

Carl Rendell cer@sol43.com
Mon, 24 Dec 2001 09:19:41 -0800


Not sure if this is a simple question or not... I've been working
through some navigational exercises, which have been working well using
dtml-in. However, I wanted to try the same sort of thing using tree, but
they appear to work differently.

Here's a dtml example:

<dtml-with "restrictedTraverse(physicalPath, _.None)">
  <dtml-in expr="objectValues(['Folder'])" skip_unauthorized="1">
  <a href="<dtml-var "_['sequence-var-absolute_url']">/index_html2"
          onmouseover="status='<dtml-var title_or_id>';return true;"
          onmouseout="status='';return true;"><dtml-var title_or_id></a>
  </dtml-in>
</dtml-with>

This works quite well, but I thought that using some of tree's built
recursion would make more complex (multi-level) problems more straight
forward. However substituting dtml-tree for dtml-in does not produce the
same result set:


<dtml-with "restrictedTraverse(physicalPath, _.None)">
  <dtml-tree branches_expr="objectValues(['Folder'])"
skip_unauthorized="1">
  <a href="<dtml-var "_['sequence-var-absolute_url']">/index_html2"
          onmouseover="status='<dtml-var title_or_id>';return true;"
          onmouseout="status='';return true;"><dtml-var title_or_id></a>
  </dtml-tree>
</dtml-with>

The tree seems to loose it context as you use the navigation to descend
into the hierarchy. I've played with id=ID and a few other things with
varying results. One example is interesting:

<dtml-let path="restrictedTraverse(physicalPath, _.None)">
  <dtml-in expr="path.objectValues(['Folder'])" skip_unauthorized="1">
  <a href="<dtml-var "_['sequence-var-absolute_url']">/index_html2"
          onmouseover="status='<dtml-var title_or_id>';return true;"
          onmouseout="status='';return true;"><dtml-var title_or_id></a>
  </dtml-let>
</dtml-with>

It yields an infinite recursion.

I'm digging into the tree behavior, and there appears to be many patches
applied to get 'just the right' type of behavior. Is there a specific
reason tree behaves this way, or is there something I missed in the
documentation along the line?

Thanks,

~C
-- 

-----
Carl E. Rendell
Solution43
Process, Metrics, and Internet Consulting  |   "Ahhhh the power of
cer@sol43.com                              |    acquisition"  - Chef Z