[Zope-CMF] Re: Problems with tree
Carl Rendell
cer@sol43.com
Mon, 24 Dec 2001 15:04:09 -0800
Hmmmm,
Not sure if I'm just limiting my thinking, or it's close to the
holidays. I was able to get the behavior I was after by making a small
change:
Was:
<dtml-with "restrictedTraverse(physicalPath, _.None)">
<dtml-tree branches_expr="objectValues(['Folder'])"
skip_unauthorized="1">
<a href="&dtml-absolute_url;"
onmouseover="status='<dtml-var title_or_id>';return true;"
onmouseout="status='';return true;"><dtml-var title_or_id></a>
</dtml-tree>
</dtml-with>
Is:
<dtml-with "restrictedTraverse(physicalPath, _.None)">
<dtml-let objSet="restrictedTraverse(base_path, _.None)">
<dtml-tree objSet branches_expr="objectValues(['Folder'])"
skip_unauthorized="1">
<a href="&dtml-absolute_url;"
onmouseover="status='<dtml-var title_or_id>';return true;"
onmouseout="status='';return true;"><dtml-var
title_or_id></a>
</dtml-tree>
</dtml-let>
</dtml-with>
Now, I'm not sure WHY it works... If anyone can explain the nuances of
the tree which are creating this behavior, I'd be thankful for the
understanding.
~C
Carl Rendell wrote:
>
> 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
--
-----
Carl E. Rendell
Solution43
Process, Metrics, and Internet Consulting | "Ahhhh the power of
cer@sol43.com | acquisition" - Chef Z