[thelist] Zope - top level folder listing cont...

martin.p.burns at uk.pwcglobal.com martin.p.burns at uk.pwcglobal.com
Thu Mar 28 12:00:01 CST 2002


Memo from Martin P Burns of PricewaterhouseCoopers

-------------------- Start of message text --------------------

In part answering my own question, but

   <dtml-in expr="PARENTS[-1].objectValues('Folder')">
worked... up to a point.

See, the fun thing is that not all of my subfolders are content folders -
some have images, some resources and some are just plain temporary
scaffolding.

So I did what I thought would be a sensible thing, set a flag on content
folders, and conditionalise like so:

<dtml-in expr="PARENTS[-1].objectValues('Folder')">
    <dtml-if isContentFolder>
     ....write out links
    </dtml-if>
</dtml-in>

But while the above works fine for
http//www.mydomain.com/foo.html
once you get into sub-directories:
http//www.mydomain.com/bar/foo.html
it all goes pearshaped as the conditionalisation doesn't work.

For some reason, the method seems to think that *all* the top-level folder
objects have this property when called from an object which has it.

Cheers
Martin


Subject:    [thelist] Zope - top level folder listing

Hi there

I'm trying to get a consistent nav to the top-level sections in my site
using Zope, with the basic idea of pulling back a list of the folders and
outputting them with links.

Simple, eh? I thought so, with a simple iteration through the top level
object along the lines of
  <dtml-in expr="rootObject.objectValues('Folder')">

My problem seems to be getting an object reference to that root object
which works at all depths of the site, as
  <dtml-in expr="aq_parent.objectValues('Folder')">
and similar only work 1 level down in the site.

Any suggestions?
Probably something which would get me the length of the PARENTS sequence
would do it, as I could then probably do
  <dtml-in expr="PARENTS[foo].objectValues('Folder')">

I'm sure the information is all there in the Zope book, but while it's a
great quick reference, it's really, really light on examples.



--------------------- End of message text --------------------

This e-mail is sent by the above named in their
individual, non-business capacity and is not on
behalf of PricewaterhouseCoopers.

PricewaterhouseCoopers may monitor outgoing and incoming
e-mails and other telecommunications on its e-mail and
telecommunications systems.
----------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error, please contact the sender and delete the material from any
computer.




More information about the thelist mailing list