[Grok-dev] Re: Portlets (and maybe other skinning).

Philipp von Weitershausen philipp at weitershausen.de
Tue Mar 20 12:31:34 EDT 2007


On 20 Mar 2007, at 00:36 , Lennart Regebro wrote:
>> * You're registering ViewletManagers and Viewlets for None (=all
>> objects) and not for context. Why?
>
> Should I register them for context? Now I'm confused, I thought it
> should be for an interface, that I could choose somehow (I haven't
> done that part).

Well, of course you register it for an interface or a class. But you  
don't get to choose it. The developer writing viewlets does by saying  
something like this:

class MyViewlet(Viewlet):
     grok.context(ClassOrInterface)

This can be left out if ClassOrInterface can be assumed, like with  
views and adapters.

>> * You're using 'main_template.pt' for the template that contains the
>> macro. This is such a bad name. I can tell you've been working  
>> with the
>> CMF for a loooooong time :).
>
> Yes, I know... :-)
> The idea is to make support for layers, and then look them up withing
> the layers and skins and have a special marker interface to select it.

That still doesn't have anything to do with the meaningless name  
"main_template". And yes, we want to do layers and skins in Grok, and  
I think that's something that should be done in Grok itself. And yes,  
layers and skins are marker interfaces in Zope 3, but we potentially  
want something easier to understand for beginners.

>> * The "viewlets do it all" approach is certainly interesting, but it
>> means that views themselves can't render whole HTML pages, only  
>> snippets
>> of HTML (e.g. the contents of the <body> tag). So when  
>> megrok.viewlet is
>> installed, all views would have to change (including Grok's own views
>> from the admin UI, for example).
>
> Well, the content portlet can strip out anything that is not inside
> the body tag. But true, I'd like to avoid that. And also, doing that
> means that without this skinning, you can put a HTML title and css and
> stuff directly in the template, and with this you can't.
>
> I have no idea of how to do layers and skinning in a way that is easy
> and fast, and does not involve changing all templates.

I do. http://openplans.org/projects/deliverance :)

> Which is why we need to decide on a way of doing this pretty soon.

Why is there a rush? It's obviously good to be thinking about stuff  
and to move forward, but why do we have to decide on something? And  
why soon? I think Grok provides us with an excellent platform to do  
some experiments that have not been possible in the grown Zope  
platform for a long time.

> It would be possible to just stick all the portlets into the HTML just
> before the </body> tag, but then we require you to actually use
> deliverance for the design, and that's not good either.

What's not good? Sticking the portlets somewhere or using Deliverance?




More information about the Grok-dev mailing list