[z3-five] Re: Using Zope2 page templates with Five

Philipp von Weitershausen philipp at weitershausen.de
Tue Jan 25 22:17:56 MET 2005


Lennart Regebro wrote:
> Philipp von Weitershausen wrote:
> 
>> Honestly, I don't see the problem. Especially I don't see why Five/CMF 
>> products couldn't use schemas and widgets. Widgets don't even have 
>> anything to do with ZPTs, they simply return a string full of HTML 
>> that the addform/editform ZPTs embed. 
> 
> 
> But in using forms and widgets there are a bunch of macros that are used 
> and need to be called.

I wouldn't know which ones. Yes, Zope 3 add/edit forms use 
@@standard_macros/page but that doesn't mean that some CMF equivalent of 
them needs to do that too.

> Anyway, if this can be transparently and easily solved, I'm all for it, 
> but I'm not gonna do it. ;) Not only am I slightly unclear on how your 
> solution would work,

It's pretty easy :). For the <browser:page> handler, you use a mixin 
class that uses zope.pagetemplate.PageTemplateFile, for the <five:page> 
handler you use a mixin class that uses 
Products.PageTemplates.PageTemplateFile. Same goes for 
browser:addform/editform and five:addform/editform, respectively.

Actually, I was thinking that Five should maybe *always* use the Zope 3 
flavour and offer nothing else while CMFonFive would propagate the usage 
of Zope 2 ZPTs by offering

  - cmf:page
  - cmf:addform
  - cmf:editform

etc. with Zope2 ZPT style behaviour. I guess that would also comfort 
Martijn's wish of keeping Five to one ZPT engine.

> I finally have Five/CMF skin integration working 
> well, and I simply don't have any more time barking up the wrong tree on 
> this issue, because I have spent weeks doing that already.
> 
> You'll just have to come to the sprint and implement it properly 
> yourself. ;)

Believe me, I wish I could :). But I could maybe find some time this 
week to sketch out a demo implementation by introducing Zope 2 style 
ZPTs on a branch of CMFonFive and you would only have to pad it out. How 
does that sound?

>> Well, one wouldn't know off hand what flavour is being used currently. 
>> You'd have to grep your whole Products folder in order to see which 
>> flavour is activated... 
> 
> Well, you mostly don't need to know, and secondly, you do know. If the 
> products you develop are for use with CMF, you'll gonna have to have the 
> Zope2 flavour running. If not, then you'll gonna use the Zope3 flavour.

Yeah, but let's pretend I install this Five-based product because it 
provides some cool components that I want to use, but its ZPTs are 
Zope3-based and my other products are CMF-based. This sounds like a very 
probable scenario that could cause one a lot of headaches.

Also, where would this switch you're propagating be defined? In 
site.zcml? Then you'd need to tell everyone installing your product to 
manually change the switch.
The other option is in each individual product which, I'm sure, will end 
up in the conflict situation when two products are trying to flip the 
switch in either direction at the same time.

Really, the more I think about it, the more I believe this could very 
well coexist in a separate product such as CMFonFive.

Philipp


More information about the z3-five mailing list