Search code examples
plonedexterity

Plone Dexterity example without Grok


Does anybody know any good examples of Dexterity-based Contenttypes, without use of Grok?

... just for learning purposes


Solution

  • Grok is kind of just a convenience wrapper around the ZCA. Your types can just be changed to use ZCML or just plain zope. For example, the following:

    class View(grok.View):
        grok.context(IProgram)
        grok.require('zope2.View')
    

    This would just convert to the following in ZCML:

    <browser:page
        name="view"
        for="IProgram"
        permission="zope2.View"
        class=".yourviewmodule.View"
        template=".yourtemplate.pt"
        />