[Zope] Tree state interaction with acquisition

Martijn Pieters mj@antraciet.nl
Fri, 10 Sep 1999 10:21:20 +0200


At 19:25 09/09/99 , Bruce Elrick wrote:
>I'm trying to understand how acquisition of objects with tree tags affects the
>tree's state (or is that trees' state?).
>
>My index_html DTML_Method in the root folder is acquired almost everywhere.
>It includes (via dtml-var) my treenav DTML_Method in the root folder which
>implements the following:
><dtml-tree
>   expr="PARENTS[-1]"
>   skip_unauthorized=1 sort=title_or_id
>   branches_expr="navigate_filter('hidden',1,cat='Folder',acquire=0,negate=1)"
>   >
>   <dtml-if hidden>
>      <!--Skipping hidden-->
>   <dtml-else>
>     <a href="<dtml-var absolute_url>"><!--#var title_or_id--></a>
>   </dtml-if>
></dtml-tree>
><a href="<!--#var URL0-->?collapse_all=1">Collapse tree</a><br>
><a href="<!--#var URL0-->?expand_all=1">Expand tree</a><br>
>
>As I jump around my site, the tree's state behaviour behaves strangely.
>
>For example, if I'm at the root and I expand the tree then click on one
>of the folder links (which are clean URL's to the folder since I use the
>absolute_url var), the state of the tree rendered there may be different,
>especially if I subsequantly jump somewhere else.

The changes to the tree state are not actually stored in a cookie, so if 
you go from one page to another that uses the same tree, you'll have to 
pass the state along.

I did this for the ZDP ZBook (http://zdp.zope.org/guide/ZBook/).

Tom Deprez, who wrote the ZBook, included a tutorial on what I did. Just 
open the Tutorials branch, open 'Creating ZBook', and click on 
'Implementing a navigation tree'. You then can see the tree in action.

You could also skip the tree and go directly to:

   http://zdp.zope.org/guide/ZBook/Outline/Tutorials/ZBook/Tut2


--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------