[Zope] - How was www.zope.org created?

Paul Everitt Paul@digicool.com
Thu, 14 Jan 1999 12:42:45 -0500


Brad writes:
> The layout of www.zope.org is just what I need.
> 
> How is it done?

Every page on the Zope site has three sections: header, body, footer.
The header is generated from standard_html_header, which is defined once
in the top level folder.

The standard_html_header document sets up the HEAD then does the table
layout for the left-hand side and the right-hand side, where the
left-hand side is the "siderbar".  To put in the sidebar, which is
logically the context sensitive menu, we merely say <!--#var sidebar-->
where we want it.

This allows each folder to define its own sidebar.  In general, though,
we don't do that.  Rather, we have automated it and just used one
sidebar Document in the top folder.

How did we automate it?  We told it to get the items in the menu from a
property of the current folder.  The property, sidebar_contents, is of
"lines" type, with each item being the definition of the entry in the
menu.

Warning, hack ahead.

Each sidebar item has three pieces of information: the label, the URL,
and whether it should be indented.  Since the folder property shamefully
only allows lines of strings, these pieces of information are separated
by a vertical bar | symbol, then a (gag) string.split is done on them.
The sidebar document also looks at the PATH_INFO to see if the current
URL is on the menu item.

Now that TinyTables has been released by Grand Master Flash and the
Furious Funk (Ty Sarna with inspiration provided by Kent Polk), there is
a much better way to do it.

In summary:

1) Have a sidebar that formats the context sensitive menu.

2) Have each folder define the data for the menu.

--Paul