[Zope] How does one refer to the root folder?

Evan Simpson evan@4-am.com
Thu, 16 Mar 2000 11:33:29 -0500


----- Original Message -----
From: Andres Corrada-Emmanuel <andres@mail.mamey.com>
> Does one call it "PARENTS[-1]"? I'm trying to get an attribute of the root
folder and I'm failing with the syntax-
> <dtml-with "rootObject=_.getitem('PARENTS[-1]')">

Urk.  First, we can pick this apart in at least two ways:

<dtml-with "PARENTS[-1]">

or

<dtml-let rootObject="PARENTS[-1]">

In either case, the part in quotes takes the last element of PARENTS, giving
you the root folder.  In the first case, we use this directly in a
"dtml-with", and can refer to properties and contents of the root folder
inside it.  In the second case, we give the root folder the local name
'rootObject' which we can then use to access it.

Cheers,

Evan @ digicool & 4-am