Posted May 06, 2009
Empty Portlets: To See or Not To See
Displaying empty portlets.
Ever have an events or collection portlet that you wished wouldn't disappear? Maybe it wrecked your three column layout...or took with it the only home page link to a news or events section of your site. How about a portlet with the option to show itself even when there are no events or items to display?
Recently one of our partners provided a use case for such a portlet. What they need is a collection portlet that continues to appear even when it is empty. The portlet itself provides a link to the events section of their site, as well as a list of the events for the coming week. Instead of disappearing when the collection is empty, the portlet should not only appear, providing the necessary link, but also display a message such as 'No events scheduled this week'.
That Plone's news, events, and collection portlets by default simply disappear when empty, is certainly a better option than having half formed portlets, with no content, popping about. But I'd like to see the option provided to users.
This could be achieved by adding a check box to the relevant portlets, allowing users to choose if a portlet should appear when empty or not. Further, including an additional text field could give users a place to input a custom message for the portlet to display when it has no items
.
Is anyone else looking for similar functionality from Plone's portlets? Take a look at the example images below and related ticket #9165 at plone.org, with suggested code details. I'd like to hear your ideas, pros/cons, and any further suggestions.
Suggested collection and events portlets appearing empty with custom messages

Suggested additions to Events Portlet

i18n