[Zope] Name of top level folder
Alexander Staubo
alex@mop.no
Sat, 12 Jun 1999 03:06:07 +0200
Well, you can write your own External Method that processes each branch,
thus:
<!--#tree expr="PARENTS[-1]"
branches_expr="FilterBranches(objectValues('Folder'))"-->
<!--#var title_or_id-->
<!--#/tree-->
The FilterBranches() function would check the list returned by
objectValues(), remove any that were not fit and return the filtered
list. Another method would be to omit the objectValues(...) call, and
have your FilterBranches() function iterate through the subobjects
itself; you might save a few nanoseconds by doing this.
Beyond that, I'm sure there is an undocumented attribute/feature
somewhere that does what you ask. If not, maybe there should be?
--
Alexander Staubo http://www.mop.no/~alex/
"`This must be Thursday,' said Arthur to himself, sinking low over
his beer, `I never could get the hang of Thursdays.'"
--Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
>-----Original Message-----
>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
>Alex.Thomas@dresdnerkb.com
>Sent: 11. juni 1999 15:14
>To: zope@zope.org
>Subject: RE: [Zope] Name of top level folder
>
>
>Next challenge is to be a bit more selective about which documents are
>displayed in the tree. For instance, could I not include objects with a
>'dontIndex' property set by filtering the list that
>ObjectValues returns? No
>idea how to code this, probably something to do with map or apply sorta
>things, if anyone has the answer to hand this should keep me
>quiet for a
>bit!
>
>thanks a lot
>alex
>
>-----Original Message-----
>From: Alex.Thomas@dresdnerkb.com [mailto:Alex.Thomas@dresdnerkb.com]
>Sent: 11 June 1999 03:31
>To: zope@zope.org
>Subject: RE: [Zope] Name of top level folder
>
>
>Ah, brilliant - the expr keyword comes to the rescue. Many
>thanks, don't
>think I would have found that for a long time.
>
>As I'm now indebted to you and the list, I might make the very modest
>contribution of the DTML that makes the multiline tree headings line up
>neatly. Well, it's a start...
>
>cheers
>alex
>
>-----Original Message-----
>From: Alexander Staubo [mailto:alex@mop.no]
>Sent: 11 June 1999 02:49
>To: Zope Mailing List (E-mail)
>Subject: RE: [Zope] Name of top level folder
>
>
>You might be confusing "name" with "id" or "title". You're right, the
>root object does not have a name, but that should stop you from
>including it in iterations, or the tree tag.
>
>To tell the #tree tag to start at the top, do:
>
> <!--#tree expr="PARENTS[-1]"-->
> <!--#var title_or_id-->
> <!--#/tree-->
>
>Note that, for obvious reasons, the top level will not be included in
>the tree. (If you're wondering how the hierarchical tree seen in the
>Zope management screens manages to include the root object,
>this isn't a
>trick performed just with the #tree tag. See
>zope/lib/python/Ap/menu.dtml for the DTML code.)
>
>--
>Alexander Staubo http://www.mop.no/~alex/
>"`Ford, you're turning into a penguin. Stop it.'"
>--Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
>
>>-----Original Message-----
>>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
>>Alex.Thomas@dresdnerkb.com
>>Sent: 11. juni 1999 02:34
>>To: zope@zope.org
>>Subject: RE: [Zope] Name of top level folder
>>
>>
>>If I have a document http:/mysite/index_html then if that
>>document calls
>>#tree I think PARENTS[0] would be the name of the top level
>>folder. However,
>>I can't use it (or PARENTS[-1] etc.) - raises a KeyError - so
>>I suspect that
>>there is no name for this folder, which is a bit of a shame...
>>
>>alex
>>
>>-----Original Message-----
>>From: Alexander Staubo [mailto:alex@mop.no]
>>Sent: 11 June 1999 01:33
>>To: Zope Mailing List (E-mail)
>>Subject: RE: [Zope] Name of top level folder
>>
>>
>>PARENTS[-1] will get you the top-level folder object, if that's what
>>you're asking.
>>
>>--
>>Alexander Staubo http://www.mop.no/~alex/
>>"`Ford, you're turning into a penguin. Stop it.'"
>>--Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
>>
>>>-----Original Message-----
>>>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
>>>Alex.Thomas@dresdnerkb.com
>>>Sent: 10. juni 1999 23:36
>>>To: zope@zope.org
>>>Subject: [Zope] Name of top level folder
>>>
>>>
>>>OK, an easy one - what's the Name of the top level folder? I
>>>need it to pass
>>>to the #tree tag so it displays the whole structure.
>>>
>>>Thanks!
>>>
>>>alex
>##########################################
>This email, its content and any files transmitted with it are intended
>solely for the addressee(s) and may be legally privileged and/or
>confidential. Access by any other party is unauthorised without the
>express written permission of the sender. If you have received this
>email in error you may not copy or use the contents, attachments or
>information in any way. Please destroy it and contact the sender on
>the number printed above, via the Dresdner Kleinwort Benson
>switchboard on +44 171 623 8000 or via e-mail return. Internet
>communications are not secure unless protected using strong
>cryptography. This email has been prepared using information believed
>by the author to be reliable and accurate, but Dresdner Kleinwort
>Benson makes no warranty as to accuracy or completeness. In particular
>Dresdner Kleinwort Benson does not accept responsibility for changes
>made to this email after it was sent. Any opinions expressed in this
>document are those of the author and do not necessarily reflect the
>opinions of the Bank or its affiliates. They may be subject to change
>without notice.
>##########################################
>
>_______________________________________________
>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 )
>