[Zope] Help needed for a s(i|a)mple site

Gregor Hoffleit flight@mathi.uni-heidelberg.de
Tue, 9 Nov 1999 23:38:40 +0100


--J/dobhs11T7y2rNN
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Hi,

I thought I could acquire the Zen by readings the docs, following the list
and just doing it, but I'm afraid I have to ask for some guidance. Please
bear with me. I'd be glad if I would get at least a few hints, thanks in
advance.


I'm trying to set up a simple (sample?) Zope site, and thought I should try
and use ZClasses.

The site should replace an existing static web site.  This current site
features a two-level folder structure. Each folder can keep one (index_html)
or multiple pages. The pages have a navigation bar at the left like
a tree, only that all leaves (i.e. folders) are always visible and that
the folder of the current page is highlighted. If there's more than one page
in a folder, a second navigation bar is displayed on the right, just a
list of the pages in the folder with the current page highlighted.

Using Zope I hope to make editing the pages and adding folders a mostly
trivial, idiot-proof issue.

I thought I could use ZClasses to customize the user interface for the
editors of the pages, so that the editors are presented only with a very
limited set of options, e.g. adding a new folder, adding a page in the
current folder, and, something that's not easy possible with the current
user interface: rearranging the order of the subfolders in a folder and the
order of the pages in a folder.

Now I'm very much lost how to model this with ZClasses. I thought about
this: First a ZClass "SPage" that's derived from DTML Document. Then another
ZClass "SFolder" derived from ObjectManager. SFolder would contain SPage or
SFolder objects. Any SFolder object should contain at least one SPage
object, index_html. Is that reasonable ? Is that possible (until now I
failed to implement this containment relations) ?

Then, where in this scheme would I put the rendering logic (i.e.
standard_html_header and footer) ? Would I put them in SPage or in the
product root ? Now if I wanted SPage objects to use structured text, how
could I modify the ZClass so that the structured text (let's say it's stored
in a property "raw" of the class) is rendered when I access the SPage
object, like it's done with DTML Documents ? Implementing a index_html DTML
method ? Didn't work as expected.

Or, how do I tell SFolder objects to render itself using the SPage object
named index_html ? Shouldn't it do that automatically ?

The worst thing yet is the highlighting in the navigation bars. I have to
implement something like (pseudo-code)

<table>
<dtml-in "sisterpages()">
  <tr>
  <td><dtml-if "thispage_id=3D=3Did"><dtml-var arrow></dtml-if></td>
  <td><a href=3D"<dtml-var "absolute_url()">"><dtml-var title_or_id></a></t=
d>
  </tr>
</dtml-in>
</table>

but in my current implementations of this code the highlighting would fail
e.g. if the SPage b in SFolder a was called not as "/www/a/b" but as
"/www/a/b/index_html/index_html".


I have the impression that this is might be a quite normal application of
Zope, nothing special, but something that's of immediate use for migrating
web sites into a Zope setup, and that this might serve as a nice sample
product for Zope newbies.

Perhaps some kind souls will give me a few hints,
thanks in advance,

    Gregor
   =20

--J/dobhs11T7y2rNN
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE4KKJw3eVfDf25G40RAQcyAJwMbgwtlJew8Sq1Cj6IfCfU2HX0MgCgjtt0
yxYQPueB7ZaJvWvLfO46iuM=
=FbWn
-----END PGP SIGNATURE-----

--J/dobhs11T7y2rNN--