[Zope] Newbie:Navigational bar

Alexander Staubo alex@mop.no
Fri, 11 Jun 1999 16:46:15 +0200


Thanks. If you need me to write a short piece around the code that
explains what it does, and how, let me know.

I read your navbar howto, which is well-written and usable. However,
personally I think that manually putting URLs in a TinyTable and
iterating that goes against the grain, or the zen if you will, of Zope
itself. Say somebody adds a page, removes a page, or changes a title --
you have to go over the TinyTable manually.

On some of my pages I use another scheme which revolves around marking
public documents with a "public" property and enumerating those. The
code looks a bit like this:

<!--#call "REQUEST.set('thistitle', title_or_id())"-->
<!--#in "PARENTS[0].objectValues(['DTML Document', 'Folder'])"-->
  <!--#if "_.has_key('IsPublic') and IsPublic"-->
    <!--#if "thistitle == title_or_id()"-->
      <img src="/Images/activedoc.gif" width="8"
        height="8"><b><!--#var title_or_id--></b><br>
    <!--#else-->
      <img src="/Images/spacer.gif" width="8" height="8"><a
        href="<!--#var id url_quote-->"><!--#var title_or_id--></a><br>
    <!--#/if-->
  <!--#/if-->
<!--#/in-->

This lists all documents and folders on the current level that have an
IsPublic property that is non-null, and also displays a "you are
here"-type of bullet next to the active document's title. All other
entries are given as links. No need to maintain a TinyTable, as the code
will discover which documents are published. The drawback, of course, is
that it only enumerates documents in its immediate parents: If you'd
like to place site-wide links in this list, you could just iterate
through PARENTS[-1] as well.

All three schemes serve slightly different purposes, but deserve equal
mention, I think.

--
Alexander Staubo             http://www.mop.no/~alex/
"In the end, we all assume room temperature." --John Maynard Keynes

>-----Original Message-----
>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On
>Behalf Of Jules
>Allen
>Sent: 11. juni 1999 15:14
>To: aem@byu.edu
>Cc: Zope List
>Subject: Re: [Zope] Newbie:Navigational bar
>
>
>Good Morning. In addition to the code you got from Alexander, there's
>a draft of a tutorial at
>
>	http://zdp.zope.org/test/jules/navbar_howto_html
>
>I think we need to do two versions of the navbar tutorial -- one based
>on Alexander's code and one based on the TinyTable. Both clearly have
>different uses but are equally important.
>
>Good luck!
>
>On Thu, Jun 10, 1999 at 07:05:33PM -0600, Adrian Esteban Madrid wrote:
>|Anybody has any idea/tutorial/rumors on how to create a
>navigational bar
>|like this?
>|
>|Home : Community : InvestorsCorner : Introduction : Disclaimer
>|
>|Each item can be linked, so you can step back to Community skipping
>|Introduction with one click.
>|
>|Any ideas would be appeciated.
>|
>|-aem
>|
>|
>|_______________________________________________
>|Zope maillist  -  Zope@zope.org
>|http://www.zope.org/mailman/listinfo/zope
>|
>|(For developer-specific issues, use the companion list,
>|zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://www.zope.org/mailman/listinfo/zope
>
>(For developer-specific issues, use the companion list,
>zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>