[Zope] Tree/nav has me perplexed
Martijn Pieters
mj@antraciet.nl
Thu, 09 Sep 1999 10:12:51 +0200
At 21:49 08/09/99 , Bruce Elrick wrote:
>Howdy all..
>
>I've read through the DTML Guide section on the tree tag as well as Tad
>Murphy's How-To, but I still can't get the tree tag to do what I want.
>
>I have folders that are meant to be part of the site hierarchy as well as
>folders that are simply used to clean up the management view of the site. For
>example, I have an Images folder at the top, but I don't expect users to
>browse to http://site/Images, so I don't want that folder to appear in the nav
>tree. If I add a property called 'hidden' to such folders and use the
>following code:
><dtml-tree
> expr="PARENTS[0]"
> skip_unauthorized=1 sort=title_or_id
> branches_expr="objectValues(['Folder', 'Squishdot Site'])"
> >
> <dtml-if hidden>
> <!--Skipping hidden-->
> <dtml-else>
> <a href="<!--#var absolute_url-->"><!--#var id--></A>
> </dtml-if>
></dtml-tree>
>Then the tree is still rendered with the 'hidden' folders but with no text
>etc. That is, it takes up space in the tree and shows a plus if it has
>subfolders. What I would like is that such folders (and their subfolders) are
>not rendered at all.
>
>I'm thinking I have to provide some code in place of the
>objectValues(['Folder', 'Squishdot Site'])
>that returns the same minus said items that have 'hidden' as a property,
>but I don't understand whether this 'code' would be a DTML method or an
>external method, or what 'type' of this it would return (a list?).
Indeed, you'd need to replace the objectValues method.
Lucky for you, someone already wrote such a method for you. It is called
Navigate version 0.0.4, and can be downloaded from
http://www.zope.org/Download/Contrib
--
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
------------------------------------------