Creating static text portlets in Plone 3.0

by John Habermann last modified Oct 31, 2009 05:43 PM

An explanation of how to use the plone.portlet.static product to easily create static html portlets.

Introduction

Plone.portlet.static is another great contribution from Martin Aspeli. It is very handy if your web editors want a portlet type they can easily drop static html content into and have a spash image,  flash video or email sign up form display on their site. I will run through how to set this up in a unified installer or buildout install of Plone, show an example of how to customise the portlets to not display a title and describe some example of its use.

Basic Setup

Plone.portlet.static is packaged as an egg rather than a old style plone product. It is included by default in buildout-cache/eggs/plone.portlet.static[some version number] in a standard buildout.

The process to add a static portlet is to:

1. Click on the "Manage Portlets" link at the bottom of the portlets.

2. From an "Add portlet" dropdown select "Static text portlet"

3. Enter a title for your portlet, this is required. We might well want to customize the static portlet package so that this is not required or we provide an option whether we display it or not.

4. Enter your html into the "Text" area, this will be rendered in the portlet.

5. Enter a footer if you want one (optional)

6. Enter a link that you want the footer and the header to go to (optional)

Making the portlet header optional

As our website manager wants to be able to use this portlet to display just a linked image or a flash video we needed to make the display of the portlet header optional. To do so, simply click the "Omit portlet border" checkbox.

The website manager can now create a static text portlet and leave the Portlet Title blank and only have the html that was entered in the text area part being displayed:

 Static Portlet Edit

(Note, the above screenshot is slightly outdated.)

Here is an example of some of the portlets created using the static text portlet type. The first is the one resulting from the screen shot above. The second is an example of the use of the Spry Ajax toolkit to display content via tabs while the last is the result of javascript that displays a flash video.

Example of portlets produced with plone.portlet.static