[Zope-CMF] [dev] five_template slots
yuppie
y.2006_ at wcm-solutions.de
Thu Mar 23 16:23:05 EST 2006
Hi!
A while ago the five_template for the trunk / CMF 2.0 was replaced by
the one from CMFonFive.
I still have some difficulties understanding the rationale behind that
change. I never got an answer to this mail:
http://mail.zope.org/pipermail/zope-cmf/2006-January/023746.html
AFAICS there are two use cases for the five_template:
1.) Provide generic slots used in Five and Zope 3
The five_template shipped with Five provides two slots: 'style_slot' and
'body'. The old CMF five_template did provide the same two slots. The
new five_template maps 'style_slot' to a non-existent 'css_slot'.
2.) Provide cmf specific slots in @@standard_macros/page
The new five_template provides 'base' and 'header', mapping them to the
corresponding slots in main_template. 'body' is mapped to 'main', so all
slots in main_template can be filled via the five_template. I'm not sure
if we really should support that use case. At least it is less important
than the first use case.
Issues:
-------
- mapping 'style_slot' to 'css_slot' is an obvious bug, that change
should be reverted
- the 'header' slot behaves different than in main_template:
main_template provides default content for 'header', the five_template
'header' is empty by default. I'd like to keep that in sync, but maybe
we should remove the default content from main_template. Most skin
templates override the 'header' slot anyway.
- the Five 'body' slot doesn't map very well to the CMF 'main' slot:
'header' *and* 'main' would match better.
Proposal:
---------
1.) Add a new 'body' slot in main_template that wraps around the
'header' and the 'main' slot. You can either use 'body' *or* 'header'
and 'main'.
2.) Remove the default content in main_template's 'header' slot.
3.) Replace five_template by something like this:
<metal:macro metal:define-macro="page">
<html metal:use-macro="context/main_template/macros/master">
<head>
<metal:slot metal:fill-slot="base">
<metal:slot metal:define-slot="base" />
</metal:slot>
<metal:slot metal:fill-slot="style_slot">
<metal:slot metal:define-slot="style_slot" />
</metal:slot>
</head>
<body>
<metal:slot metal:fill-slot="body">
<metal:slot metal:define-slot="body">
<metal:slot metal:define-slot="header" />
<metal:slot metal:define-slot="main" />
</metal:slot>
</metal:slot>
</body>
</html>
</metal:macro>
4.) Change the browser view templates to use 'main' instead of 'body'
(that no longer maps to 'main').
Any feedback is welcome. If there are no objections I'd like to make the
proposed changes on Saturday, before the 2.0-beta2 release.
Cheers,
Yuppie
More information about the Zope-CMF
mailing list