Subject: Re: [Zope] dynamic & automatic 3 level navigation bar ?

Tino Wildenhain tino@wildenhain.de
Wed, 28 Feb 2001 11:49:19 +0100


Hi Georg,

I recommend the following precondition:

either use a hierarchy of zclasses derrived from folder
for better structure of the site or at least do the following:

write a index_html method high up in the path, which would call
everything needed like standard_html_header and footer,
navigation bars and last but not least: a content object. lets assume
you are using "content" (a DTML-Document) for the sake of example.

This way you are very flexible with the way your site looks and feels.
Authors only have to provide folders and one content object inside them.

The navigation would only address the folders. Their index_html inherited
from the root will display the content according to your rules.

Now lets come to the navigation bar:

You can call it from index_html like that:

<dtml-with "PARENTS[-1]>
  <dtml-var navigation_bar>
</dtml-with>

And here the framework of navigation_bar (the method has to be in your zope 
root)

<dtml-in "objectValues('Folder')" skip-unauthorized>
   <dtml-if title> <dtml-comment> just to make sure we are showing anything 
</dtml-comment>
      <dtml-if "sequence_item in PARENTS">
          <dtml-var title> <dtml-comment> we are in parents so this part 
shows an open branch </dtml-comment>
          <dtml-var navigation_bar> <dtml-comment> we have opened this 
folder so show its content</dtml-comment>
      <dtml-else>
          <a href="<dtml-var absolute_url>"><dtml-var title></a>
      </dtml-if in PARENTS>
   </dtml-if title>
</dtml-in Folder>


HTH
Tino Wildenhain


--On Mittwoch, 28. Februar 2001 08:41 +0100 Georg Hoermann 
<schorsch@ecology.uni-kiel.de> wrote:

> Hallo Zope-world,
>
> I have a problem I think someone *must* have already
> solved.
> I am (relatively) new to zope and I want to offer zope as
> an easy to use  simple
> CMS for our scientists and students. The put their stuff/files
> into zope and thats it. No fuzzing around with navigation bars,
> frames and so if they do not want.
> They will create rather deep file-hierarchies and the navigation bar
> taken from standard_header. This is where my problem comes in:
>
> I need a simple (text is enough) navigation bar which shows a menu of
> (all) the entries/folders at the actual, the parent and the
> child level. So even at level 20 there would only be a
> simple 3-level navigation bar with the actual position
> in the middle which adapts itself dynamically to the position
> within the file system.
>
> All the navigation bars I encountered up to now (including the
> tree tag) clutter the screen if the hierarchy becomes to deep/large,
> must by manually created and maintained or do not adapt
> to the hierarchy level.
>
> Is there a solution or could anyone help me with this ?
> If someone could program it I promise to write a decent
> documentation and do the polishing 8-).
> I learned a lot about zope
> looking at the code of the existing products but
> I am fed up in the mixture of many differents manuals,
> 164 HowTos, the source code and the zope book.
>
> Thanks & Greetings
>
> Georg
>
>
> --
> Georg Hoermann, Ecosystem Research Center, Kiel University, Germany
> Tel. #49-431-880-4029, fx: -4083 Home: 0451/47 70 32, -33 fax, 0172/431
> 57 15 schorsch@ecology.uni-kiel.de
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )