Skip to content. | Skip to navigation

Four Digits | Willemsplein 44, 6811 KD Arnhem, The Netherlands | info@fourdigits.nl
 
Ralph Jacobs is one of the CEOs of Four Digits and a Zope developer for seven years. Ralph has more experience on the back-end of software systems and has contributed on several different CMS's and lately on Plone At the moment Ralph is maintainer and developer of the Classifieds addon product for Plone. Next to that he's working on UI/accesibility guidelines together with Laurens. Also Ralph plays in a live electronic techno/electro live-act called 303F. (303f.nl)
 

Working on portlets? Want to make it Plone 3, 4 and 4.1 compatible? Do this!

by Ralph Jacobs Aug 05, 2011

Some hands-on advice how to work on portlets in Plone 3,4 and 4.1

Most portlets use the "cmf.ManagePortal" permission to edit a portlet.
The startup code of Zope (application server which Plone is based on) has changed to some degree in Zope 2.13 and there might be some code that no longer works - if it depended on specific import time and ZCML configuration ordering. In Plone 4 you generally need to be more explicit about your ZCML dependencies. If you use the the cmf.ManagePortal permission, you can either do an <include package="Products.CMFCore"file="permissions.zcml" /> (which works in Plone 4.0.x as well) or do a  general include of Products.CMFPlone at the start of your configure.zcml.

Example (conifigure.zcml of fourdigits.portlet.twitter, which is in the collective):

<include package="Products.CMFCore"
file="permissions.zcml" />

I've found out that this works well for Plone 4 and Plone 4.1 but this breaks on older Plone 3 installations, due to refactoring of Plone/CMFCore. There is a solution to this called to make this more conditional, called: "zcml:condition". If you add a zcml:condition to 'detect' Plone 4.1 it will work in Plone 3, Plone 4 and Plone 4.1. Example:

<include package="Products.CMFCore"
zcml:condition="have plone-41"
file="permissions.zcml" />

Enjoy!

 
Made by Four Digits based on Plone.
Made by Four Digits based on Plone.