Customize the ReadOnlyError Message
It's a common maintenance procedure to make your Zope/Plone database read-only while performing maintenance or upgrades. If you do so, you may want to display a message to let users know.
The default error message template is an easy place to create such a message. All you need to do is detect the error created by an attempted database write and respond with a custom message.
The template for the standard error message is default_error_message.pt, which is in the plone_templates skin folder. You may customize this skin-layer template in an add-on product, or just create a temporary customization in the "custom" skin folder via the ZMI.
Just insert a message like:
<div tal:condition="python: err_type=='ReadOnlyError'"> <p>Sorry! We're performing scheduled maintenance at this time, and it won't be possible to make any changes to your site content.</p> <p>Tell 'em where to contact the help staff with questions ...</p> </div>
Checking for ReadOnlyError makes sure that the error message will only appear if the database is in read-only mode.
I've found it convenient to put this message right after the "We’re sorry, but there seems to be an error…" headline. You're welcome to put it elsewhere.
What about logins?
A Plone log in writes the login time to the last-login field in the member's record. That means that logging in provokes a ReadOnlyError. In this case, I think this is actually a convenience, since it will allow for warning your users before they try to do any real work.
