[Zope3-dev] Re: Macro vs. Pagelet
Tonico Strasser
contact_tonico at yahoo.de
Mon Dec 13 20:08:41 EST 2004
Jean-Marc Orliaguet schrieb:
> Tonico Strasser wrote:
>
>> Jean-Marc Orliaguet wrote:
>>
>>> RENDERERS
>>> render the page elements (HTML renderer, XML, ESI) and the Style
>>> elements
>>
>>
>>
>> Interesting, I'd rather try to render the whole page instead of
>> individual elements. I've written a pseudo page renderer with Python
>> scripts in Z2 (don't laugh, I'm not an application developer).
>>
>> Here an example of a view:
>>
>> ---
>> page = container.Page()
>>
>> names_ud = container.names_for_this_page()
>> macros_ud = {'content_body': ('template_name', 'macro_name')}
>>
>> page['updateNames'](names_ud)
>> page['updateMacros'](macros_ud)
>>
>> return page['render']()
>> ---
>>
>> Tonico
>
>
>
> Hi,
Hi!
>
> There are some reasons why you'd want to render portions of a page for
> instance a left column or a header to put that fragment behind a squid
> w/ ESI. Page elements usually of have their own update frequencies too
> (from a few seconds to a few days).
I have no experience with ESI. I hope I don't need it ;)
> Besides there is not such notion as one single page to do a rendering of.
> There is an area of the screen in which various page contents are
> aggregated giving an impression of unity in space and time. In
> document-centric portals it is the document that is a factor of unity.
> In news sites it is time that is a factor of unity (what has happened a
> few minutes ago), in topic sites it is a given topic that is a factor of
> unity, ... You may want a view that renders all content that took place
> yesterday, or all content that is pending, not just in one box but in
> one page.
A visitor sees what you describe, but the rendererd output is a single
HTML page.
Back to pagelets: I wondered why I would need pagelets and how I could
use them. The first use case that came into my mind was to have
universal reuseable components like breadcrumbs, a byline, a navigation,
etc.
I found that I can cover most of my use cases with Python scripts and
macros, and everything where glued together by conventions. Those
conventions include macro names, CSS names, HTML markup, JS environment,
icons, etc.
But a pagelet that connects to a page via an interface would be much
stronger than conventions, I think.
Tonico
More information about the Zope3-dev
mailing list