[Zope3-dev] Resource Library Proposal

Benji York benji at zope.com
Fri Sep 16 17:27:31 EDT 2005


Garrett Smith wrote:
> That's right. But the view can solve these problems easily without a
> lot of other stuff like yet-another-ZCML directive and automagical
> transformation of the HTML head element.
> 
> This is what we have:
> 
> class IHeadContent(Interface):
>     """Something that provides head content for a page."""
> 
>     def headContent():
>         """Returns a sequence of HTML snippets to be added to the page head."""
> 
> class SomeView(BrowserView):
> 
>     def __init__(self, context, request):
>         ...
>         self.headContent = []
>         for widget in self.widgets():

Like I said before, they're not always widgets.  For something like this 
to work you have to be able to enumerate all the page components no 
matter what type of thing they were.  That's not always convenient or 
even possible and seems more constraining than the proposal.

> The applicable PT:
> 
>     <head>
>         <tal:block repeat="content view/headContent">
>             <tal:block content="structure content" />
>         </tal:block>
>         ...
>     </head>

The proposed solution also does not require any dead chickens in ZPT.
-- 
Benji York
Senior Software Engineer
Zope Corporation


More information about the Zope3-dev mailing list