What's a Portlet?

Description

This manual covers what a developer needs to know to create new portlet types or customise existing ones.

Portlets are UI elements that can be shown in addition to the main content of a page. They usually appear in the left of right columns, but are sometimes also used instead of or below the main content. They are usually boxes of different kinds, which content editors can add, configure, and set policies for showing.

(Screenshot).

Differences with viewlets

A portlet is like a viewlet but with persistent configuration (i.e. persistent in the ZODB) and runtime 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 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; e.g. the 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. the Review portlet is only shown to users who belong to the Reviewers group.

Table Of Contents

About Plone

This is documentation for Plone®. Plone is a popular, open source, content management system written in Python programming language.




Edit this document

The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.

  1. Go to What's a Portlet? on GitHub.
  2. Press Fork and edit this file button.
  3. Edit file contents using GitHub's text editor in your web browserm
  4. Fill in the Commit message text box at the end of the page telling why you did the changes. Press Propose file change button next to it when done.
  5. On Send a pull request page you don't need to fill in text anymore. Just press Send pull request button.
  6. Your changes are now queued for review under project's Pull requests tab on Github.

For basic information about updating this manual and Sphinx format please see Writing and updating the manual guide.