Quantcast
Channel: Planet Plone - Where Developers And Integrators Write
Viewing all articles
Browse latest Browse all 3535

Mock It!: Getting registry settings in Plone to display in fieldsets

$
0
0
Although still a little rough around the edges with regards to supporting less trivial fields such as rich text, Plone's new settings registry framework works really well. It basically lets you point to a Zope schema interface and have the contained fields presented as a control panel form.

I recently wanted to code up a control panel form modelled as a series of fieldsets (displayed with a tabbed interface in Plone). Each of the fieldsets corresponded in my case to its own interface declaration, but potentially I wanted to allow for any sort of nesting.

This proved to be somewhat out of the ordinary for plone.registry. It includes a records proxy class which neatly does the mapping between the interface and the registry. The following gist includes two points of interest in particular: an abstract records proxy class that takes care of this mapping for any type of schema and it also demonstrates the syntax for rendering your interfaces in different form groups – which will ultimately display as form tabs.


There currently seems to be the issue that error messages that appear inside a tab aren't immediately visible when you post back the form. The user will for the moment have to interpret the generic error message as "please look under each tab to find the concrete error".

Viewing all articles
Browse latest Browse all 3535

Trending Articles