[z3-five] Using templates for content providers

Anton Stonor anton at headnet.dk
Wed Aug 30 08:00:35 CEST 2006


Philipp von Weitershausen wrote:

>>> Another, related issue: Is it possible in ZCML to configure a page 
>>> template to be used for a content provider - like for normal views?
> 
> Well, you can either refer to the template in the class via
> ZopeTwoPageTemplateFile (which has an called ViewPageTemplateFile in
> recent Five versions, I think that reads better and it has the same name
> as its Zope 3 equivalent), like you do above.

Right, good point to use the alias.

> You could also do it all in ZCML by registering a viewlet with
> class="..." and template="..."

I ended up taking that path even though you need viewlet managers.

Actually I don't really understand why we need two different concepts 
(content providers and viewlets) that are so similar. Why not just deal 
with viewlets that can be registered with a viewlet manager or stand 
alone? Anyway, that's another discussion.

Thanks,

Anton



More information about the z3-five mailing list