[Zope-dev] Re: [Repoze-dev] repoze.bfg

Brandon Craig Rhodes brandon at rhodesmill.org
Thu Jul 17 15:31:31 EDT 2008


Malthe Borch <mborch at gmail.com> writes:

> On Vudo, the view is always a "layout". It's then up to the layout to 
> provide regions in which you can plug in a "region content provider". 
> Typically, you'd plug in at least the following:
>
> -- Title provider: Renders the title of the page (in <title></title>)
> -- Content provider: Renders the content of the page as widgets
>
> There are many more options to this scheme. You could plug in a portlet 
> manager, or a viewlet manager or a global navigation.

Someone mentioned Vudo to me last week.  I said that I was tempted to
write an extension to Grok that lets you create a "grok.Layout" template
that maybe is inherited throughout your whole site if you don't specify
otherwise, and then a "grok.View" on an object would just generate
content for the "main" pane inside of that layout, and viewlets could
keep working like they do today but fill in other parts of the layout.

This is kind of how people look to be doing things today with the
viewlets revolution that's going on in Grok land; look at:

 http://svn.zope.org/Grokstar/trunk/src/grokstar/blog.py?rev=87483&view=auto

and note how many of the "grok.View" objects are specifying the same
dratted template, over and over again, and then rely on viewlets to
actually fill in the varying parts of each page that change with the
content.  It struck me as a situation that is just crying out for a
"grok.Layout" local utility that provides the template everywhere under
a part of a site automatically, so that the "grok.template(...)"
declaration does not have to get repeated so incessantly.

It really looks to me like Grok best-practices are evolving towards a
layout-centric, rather than a macro-centric, approach, and that
something like the Vudo approach would make this all easier to manage.

Do I sound on-target, or like I'm missing something?

-- 
Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon


More information about the Zope-Dev mailing list