Skip to main content

Manage configuration of browser views

Project description


This add-on does not provide feature to Plone. It is intended to plone add-ons developers.

It provides base class to let your view being configurable (ie have ‘settings’).


  • Configuration providers

  • Configuration structure defined with zope.interface & zope.schema

  • Store configuration using plugins

  • Generated form from the schema to let owner configure the current view


3.0 is a back to 1.0.

2.0 branch was about to use on the context using collective.registry. After doing this the addon loose the ability to have optimized settings (mixin of globals and locals). So lets revert this and continue the 1.0 in 3.0 !

Why doing this in an add-on

Because most of the time developers faced to this issue store data in the content type, or with annotation on context without trying to optimize, or without form, …

How it works

This add-ons define three components:

  • ConfigurableView

  • ConfigurationProvider

  • ConfigurationMutator

The main idea, is you just have to create an zope.interface to define settings schema and set this schema in the ‘settings_schema’ attributes of the view.

For example:

class IMyViewSettings(interface.Interface):
    width = schema.ASCIILine(title=u"Width",

    height = schema.ASCIILine(title=u"Height",

class MyView(ConfigurableBaseView):
    settings_schema = IMyViewSettings

    def width(self):
        return self.settings.width

    def height(self):
        return self.settings.height


This component is responsible to return settings. It has been implemented in different adapters

Provider (no named adapter): this provider load default values from the interface fields defaults values and it let other providers override values. It is an aggregation of all providers specified in the view throw the settings_providers attribute. Warning: The order is important, each settings are taken from the last provider which provide it.

‘’: this provider return values from (you have to register your settings_schema as records in registry.xml)

‘’: this provider return values stored in annotation on the context of the view.


This component is an extension of IConfigurationProvider with the write settings capabilities (throw its ‘set’ method).

‘’: this mutator store the configuration in the context of the view.


This component is implemented in a browserview you are supposed to inherits from in your own browser view.

The default behavior is to use ‘’ as mutator and the following providers:



Common use case: use a javascript library for a view

Most of javascript libraries wait for a dict to load their configuration. You can achieve this in a very easy way. You just have to define a configuration schema and add the following snippet in your template to create a javascript variable with the configuration

<script type="text/javascript" tal:content="view/settings_javascripts"></script>

You can set the variable name throw the jsvarname attribute of your browserview.

You will find examples in the following addons:

  • collective.galleria

  • collective.galleriffic

  • collective.googledocsviewer






3.1.0 (2016-08-23)

  • When configuration is changed, an IConfigurationChangedEvent event is fired [keul]

  • When view settings is modified also store a modification date inside a __modified__ key. This may help in rare cases when you need to check if configuration is “fresh” [keul]

3.0.3 (2016-05-12)

  • Added italian translation [keul]

  • Fixed i18n machinery [keul]

  • Add uninstall profile. [thet]

3.0.2 (2013-04-30)

  • Fix configuration error by forcing the load zcml of CMFDynamicViewFTI [toutpt]

3.0.1 (2013-04-29)

  • protect configviews form with a permission [toutpt]

3.0 (2013-03-25)

  • add support for viewlet [toutpt]

3.0a1 (2013-02-15)

  • Revert to 1.0 internal design. [toutpt]

2.0 (2012-01-30)

  • Use collective.registry instead of provider/mutator [toutpt]

1.0b4 (2011-12-07)

  • add new classifiers [toutpt]

  • fix tests [toutpt]

  • fix issue making edit configuration not working [naro]

1.0b3 (2011-08-01)

  • Optimization of storage: defaults are now based on all provider except [toutpt]

  • fix case where are not set (value was set to None) [toutpt]

1.0b2 (2011-06-30)

1.0b1 (2011-06-08)

  • Initial release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective.configviews-3.1.0.tar.gz (22.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page