[Zope-CMF] Placeful default skin?

Jon Edwards jon@pcgs.freeserve.co.uk
Tue, 11 Dec 2001 23:54:37 -0000


> But my customer wants the default skin inside "News" to be different
> from the global one. Also, sooner or later he'll want Sports to use a
> different skin too.

The way we do it (or rather, the way I'm rewriting our CMS to do it), is to
add properties to Portal Folders - "stylesheet_choice" and "layout_choice"

Then create our different layouts (DTML methods) in a folder in
portal_skins. Then I've hacked all the View methods for different Types to
just do -

<dtml-var "_.getitem(layout_choice, 1)">

and created a "pageview" method for each Type, that just calls the "guts" of
the object (eg. <dtml-var CookedBody> for a document).

The layout has all your html/dtml code for the page, with a hole where the
page body would go that has -

<dtml-let method_name="getTypeInfo().getActionById( 'pageview' )">
  <dtml-var expr="_[ method_name ]">
</dtml-let>

...there's also a bit in the header of each layout that calls the
"stylesheet_choice" stylesheet.

That way you can have different layouts and stylesheets in different
folders, ad infinitum!

N.B. if you put as much stuff as possible in the layout (rather than
splitting it into headers, top bars, and other methods), and stick a .htm
extension on it, it should be fairly easy for designers to edit it in
Dreamweaver or wysiwyg widgets... that's the theory anyway!

Hope that helps... or that someone can point out where I'm going wrong! :-)

Cheers, Jon