[Zope3-Users] Laying out a Site

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Sep 6 06:13:47 EDT 2006

On Sunday 23 July 2006 17:24, Gabe Boys wrote:
> 1)       I create a skin and in that skin a new layer plus the default and
> rotterdam layers.  Then each view I have in the future, I put on the layer
> for my skin.

In my projects we are not reusing rotterdam at all, because it has too much 
cruft. We ususally start with a "minimal layer" package that just contains 
traversal error handling and a few other registrations and go from there.

> 2)       I create a macro that holds the basic markup for all of the pages.
> In this macro I have slots for the different parts of the page.  I would
> have slots for the title, meta, style in the header.  Then in the rest of
> the doc I put slots where dynamic content will be going.  So for example I
> would have a main content area, a side bar area and so on.

While we are still using a master template, or set of mast macros, their role 
has greatly diminished. We use zope.contentprovider and zope.viewlet heavily 
to make the UI pluggable. We also usually use a *much* smaller amount of 
slots in our main template.

> 3)       Once I have all these slots set up then I make templates for the
> different content types I have.  So for example in my task there is a
> Project that has a bunch of attributes.  I would create template for a user
> to view the project.  When the user goes to the template for that Project,
> they see the attributes from the Project displayed per how the template is
> set up.

Yes, the new mode of operation is to use zope.formlib.

> Is that the right general idea?  I have recently heard of viewlets also,
> does anyone have any experiences good or bad with them?

You get the general idea right, but the books are a bit outdated and don't 
present the latest patterns. As one of the authors of viewlets, I think they 
are great of course. I would go so far: If you do not use viewlets in a new 
Zope 3 project, you are a fool. :-) Viewlets are components for the UI.

Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training

More information about the Zope3-users mailing list