Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to group Plone portlet fields into fieldsets?

Tags:

portlet

plone

I have a very long portlet edit screen so I'd like to group its fields using fieldsets (and then probably layouting those into native form tabs, like those used in content's edit view).

Is this possible with zope.formlib?

like image 995
Davi Lima Avatar asked Aug 28 '13 17:08

Davi Lima


1 Answers

To conclude, the answer for Plone 4 really is to use z3c.form based portlets and create fieldsets by inheriting the form schema from plone.supermodel.model.Schema and defining the fieldsets using plone.autoform.directives.fieldset: https://pypi.python.org/pypi/plone.autoform#organizing-fields-into-fieldsets

The support for them was introduced in plone.app.portlets 2.3 (while the latest Plone 4 version during writing is 2.5.1).

It should be enough to use a following z3c.form based portlet form base classes instead of the formlib ones:

from plone.app.portlets.browser.z3cformhelper import AddForm
from plone.app.portlets.browser.z3cformhelper import EditForm

It's also good to know that z3c.form based portlets will be the default in Plone 5 (and base classes in z3cformhelper are made the default base classes).

like image 165
Asko Soukka Avatar answered Nov 15 '22 11:11

Asko Soukka