Status messages

Status messages are session-bound information which allow the user to see notifications when the page is rendered next time.

Status messages are stored session in safely manner which prevents Cross-Site Scripting attacks which might occur due to delivering message information as HTTP GET query parameters.

Setting a status message

Status messages have text (unicode) and type (str). All pending status messages are shown to the user when the next page is rendered.

Example:

from Products.statusmessages.interfaces import IStatusMessage

messages = IStatusMessage(self.request)

messages.addStatusMessage(u"Item deleted", type="info")

Example which you can use in Python scripts:

# This message is in Plone i18n domain
context.plone_utils.addPortalMessage(_(u'You are now logged in. Welcome to supa-dupa-system.'), 'info')

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 Status messages 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.