[Zope] Re: Zope digest, Vol 1 #1363 - 51 msgs

Carl Robert Blesius crb@uni-hd.de
Wed, 2 May 2001 10:13:42 +0200


Hello Zopeople,

I found the menu suggestion below by Tino very good (exactly what I 
have been trying to do for the last week). I would like to modify it 
slightly though=85 and can not get it to work. Can someone please help 
me out?

How do I traverse the folder hierarchy of zope stopping at the first 
object with the property menue_root (I have it built into a folder 
like ZClass). I am trying to search *upwards* until I find the first 
object with a menu_root property (I want to make the sidebar menu 
start at a folder below root for departments of my faculty below the 
central pages)?

Carl


On 30 Apr 2001, at 20:27, zope-request@zope.org wrote:

> Message: 48
> Date: Tue, 01 May 2001 02:22:45 +0200
> From: Tino Wildenhain <tino@wildenhain.de>
> To: Robert Segall <roseg@apsis.ch>, zope@zope.org
> Subject: Re: [Zope] dtml-tree info
> 
> Hi Robert,
> 
> I do this and I dont use the tree-tag at all anymore.
> The trick is to organisate your site hierarchically.
> I do only folder-like objects with one content-object
> (or property or whatever).
> So the site is simply a tree of folderobjects (not folder
> itself but a subclass (or more then one subclass of it))
> Then a simple method can render the navigation:
> (lets call it navigation)
> <table>
> <dtml-in "objectValues('TheFolderClass')">
> <dtml-if "sequence_item in PARENTS">
> <tr><td>[-]</td><td>&dtml-title;<br>
>            <dtml-var navigation></td></tr>
> <dtml-else>
> <tr><td>[+]</td><td><a 
> href=3D"&dtml-absolute_url;/">&dtml-title;</a></td></tr>
> </dtml-if>
> </dtml-in>
> 
> This is the very simple approach, you can make more
> design if you want. The trick is "sequence_item in PARENTS"
> which is true if the actual object is in your URL path.
> This way the tree shows your current navigation without
> bothering to save the treestate or bother the user with ugly
> cookies and/or URLs.
> 
> I have to mention you must call this "navigation" method
> inside a index_html method or something you let acquisite.
> Call is there like that:
> 
> <dtml-with "PARENTS[-1]">
> <dtml-var navigation>
> </dtml-with>
> 
> To start the tree at the root.
> 
> Oh, you have to use "_['sequence-item'] ... " and stuff if
> you dont use my dtml-in replacement.
> 
> HTH
> Tino Wildenhain
> 
> --On Montag, 30. April 2001 20:37 +0200 Robert Segall <roseg@apsis.ch> 
> wrote:
> 
> > Hope someone has already run into this: I need to be able to control
> > the tree display state from dtml and I can't find any info on the
> > subject.
> >
> > The "normal" tree display has the "+" (or "-") part, with its own
> > URL that includes an encoded argument, and the user-defined part. At
> > the very least I would like to be able to mimic the behaviour of the
> > "+" by clicking on the "user" part (which I make into a link by
> > myself). To make matters worse, this link may take me to another
> > object (page).
> >
> > Ideally, I would like to be able to control the display behaviour -
> > saying which branch(es) are to be shown open and which closed, and
> > to which level, within the page itself.
> >
> > Any pointers would be greatly appreciated. Tnx,
> >
> > Robert