What's a portlet?

by Plone Documentation Team last modified May 31, 2009 06:42 PM
Contributors: Mikko Ohtamma, Martin Aspeli, Kamon Ayeva, Israel Saeta Pérez
This manual covers what a developer needs to know to create new portlet types or customise existing ones.

Portlets are chunks of information that can be shown outside the main area of a page. They are usually boxes of different kinds which content editors can add, set properties of and policies for showing.

(Screenshot).

Differences with viewlets

A portlet is like a viewlet but with persistent configuration (i.e. persistent in the ZODB) and run-time changeable assignments.

Use a viewlet for:

  • General content which is always displayed, for example: breadcrumbs, the logo, or the footer. This is not limited to only visible elements but can also include CSS, javascript, etc. (actually, that's how ResourceRegistries work).
  • Displaying elements based on the interface provided by the current context.

Use a portlet when:

  • You need to specify the configuration data for an item. - i.e. number of entries to show.
  • You want to give the content editors a choice about when and where to display it.
  • You want to display it only from inside a specific folder.
  • You'd like to show it only to some groups or users - e.g. Review portlet only is shown to users within the Reviewers group.