[Zope] Id of root object?

Terry Hancock hancock@anansispaceworks.com
Thu, 08 Nov 2001 22:14:17 -0800


Hi, I'm (obviously?) a new Zope user.

I've been working on a website -- originally it was
organized as:

http;//my_url:8080/AnansiWWW

where "AnansiWWW" was a folder, and everything else
was below that. However, for various reasons, it's
clear that we want the public version of the site to
have the stuff in AnansiWWW appear at the root level,
i.e:

http;//my_url:8080/

So I've been trying to move stuff up. However, I've
been using a navigation bar that uses a bit of code
like this to determine where "Up" should be for each
folder:

<dtml-var expr="_.getitem(Up).absolute_url()">

This is nice, because I can set "Up" to be a property
of the folder and exercise a bit more creative control
over the navigation bar's behavior.  It worked fine
before, where going to the home page could be acheived
by simply setting Up to "AnansiWWW".  I tried some
alternatives before coming up with the "getitem" approach
above, but I couldn't figure out anything simpler that
would do what I needed.

But here's the problem -- now I want that to resolve
to simply: "/" in the event that Up is simply the
home page. I can't reasonably use "index_html", because
that might resolve to some intermediate folder that
was not intended ("index_html" being used in a lot
of places). For this to work, I need an ID for the
root folder.

I've not been able to find any reference to this in
the documentation I have, and obvious guesses like
"" "root" "/" "_" "." ".." "Root Folder" "BASE0"
etc, don't work.

I even tried leaving out the "Up" property and using
a "missing" line in the DTML, but that doesn't work
either (apparently it still tries to evaluate the
getitem() and generates an error.

If it's really not possible to refer to the root
object, then how else could I code this to acheive
my purpose?

Thanks!
Terry Hancock

-- 
------------------------------------------------------
Terry Hancock
hancock@anansispaceworks.com       
Anansi Spaceworks                 
http://www.anansispaceworks.com 
P.O. Box 60583                     
Pasadena, CA 91116-6583
------------------------------------------------------