[Zope3-dev] Re:
Jim Fulton
jim at zope.com
Tue Nov 9 16:39:31 EST 2004
Tonico Strasser wrote:
> Jim Fulton wrote:
>
>> For me, the scope is broader than that. Uptimately, the goal is to
>> produce pages that end users see. I see composition at various levels.
>> For example, I'm *finally* understanding how poorly our page-macro
>> system works. When a developer defines a page as a view of some
>> object, they shouldn't have to say how the page is wrapped with the
>> site look and feel. That should be the concern of someone else.
>> There should be a mechanism for "composing" these pages with the site
>> look at feel.
>
>
> Thinking in page templates I would try to solve it this way:
I assume by "it" you mean the problem of making individual pages
responsible for providing the layout.
> pt_1: The layout
> ---
> <layout metal:define-macro="layout">
> <main>
> <wrapper>
> <page_header metal:define-slot="page_header"/>
> <wrapper>
> <content metal:define-slot="content"/>
> </wrapper>
> </wrapper>
> <page_footer metal:define-slot="page_footer"/>
> </main>
> </layout>
> ---
>
> pt_2: The main template
> ---
> <page metal:define-macro="page">
> <metadata/>
> <body>
> <layout metal:use-macro="here/pt_1/macros/layout">
> <page_header metal:fill-slot="page_header">Header</page_header>
> <content metal:fill-slot="content">Content</content>
> <page_footer metal:fill-slot="page_footer">Header</page_footer>
> </layout>
> </body>
> </page>
> ---
>
> This way, I can switch to a different layout by using a different layout
> macro (and stylesheet).
>
> This is a silly example, but I hope you get the idea.
Nope, not at all. Regardless of how you implement the layout,
the individual pages have to invoke the main template some how. I think
there are a number of problems with that. I don't think the solution lies
in more macros.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list