Ticket #9165 (new Feature Request)
News, events, and collection portlets that render when empty
| Reported by: | miguelitosm | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | Ongoing |
| Component: | Templates/CSS | Keywords: | portlets |
| Cc: | hoss |
Description
We have content providers that would like there events portlets to display on their homepage, with a message such as 'No events scheduled this week', instead of disappearing entirely.
Adding a empty_display check box, and empty_message text field to Event, News and Collection portlets would allow them to render and appear with a custom message when there are no items to display. The the display when empty option would be to allow users to chose if they want portlets to render even when empty. And the empty message option to enter a custom message or a default 'No items found' message.
The empty_display would be used in the Renderer to define whether the portlet is available. The empty_message would only be used by the portlets template.
Works with preexisting portlets.
Attachments
Change History
Changed 3 years ago by miguelitosm
-
attachment
collection.pt.txt
added
Changed 3 years ago by miguelitosm
-
attachment
collection.py.txt
added
suggested changes to collection portlet class
Changed 3 years ago by miguelitosm
-
attachment
events.pt.txt
added
suggested changes to events portlet template
Changed 3 years ago by miguelitosm
-
attachment
events.py.txt
added
suggested changes to events portlet class
Changed 3 years ago by miguelitosm
-
attachment
news.pt.txt
added
suggested changes to news portlet template
Changed 3 years ago by miguelitosm
-
attachment
news.py.txt
added
suggested changes to news portlet class
comment:1 Changed 3 years ago by kleist
- Type changed from Bug to Feature Request
- Component changed from Unknown to Templates/CSS
comment:2 Changed 3 years ago by vincentfretin
Hi, For i18n, you should use a msgid and a default, so instead of:
_(u"If enabled, the portlet will appear, even if no news items exist.")
use:
_("description_empty_display", default=u"If enabled, the portlet will appear, even if no news items exist.")
Please internationalize yours templates, instead of:
<tal:noresults tal:condition="not:view/results">
<span tal:content="view/data/empty_message|string:No items found.">
No Results Display Message
</span>
</tal:noresults>
You should do something like this:
<tal:noresults tal:condition="not:view/results">
<span tal:content="view/data/empty_message|default" i18n:translate="text_no_items_found">
No items found.
</span>
</tal:noresults>
Please see http://dev.plone.org/plone/wiki/TranslationGuidelines for i18n msgid prefix.

suggested changes to collection portlet template