Broadcast Message Handling
Introduction
A broadcast message handling has been added to TWiki's default view template. The idea is to be able to convey an important message to all TWiki users, like for example a scheduled downtime of the server.
Specification
- Add a BROADCASTMESSAGE variable to the TWikiPreferences
- Add a
%BROADCASTMESSAGE%
at the beginning of the view.tmpl
script
- Skins can do the same to get this functionality
- Skin developers: Please take not of this
- If the BROADCASTMESSAGE variable is set to an empty message, nothing is shown. This is the default
- If the BROADCASTMESSAGE variable is set to a message, it is shown at the top of every TWiki page, like for example:
NOTE: | We will disable edit and attach in one hour for a scheduled server upgrade. Please save your changes now. |
Note to Skin developers
You can retrofit your existing view skin. The following is an example using style sheets. Add this to
view.myskin.tmpl
:
<style type="text/css">
.broadcastmessage {
background: yellow; display:block;
border-style:solid;border-width: 2px;border-color:red;
}
.broadcastmessage strong {color: red}
</style>
Then add the
NOTE: Edit and Attach will be disabled today ... variable after the
#PageTop
anchor or after the opening form tag:
<div class="broadcastmessage"> %BROADCASTMESSAGE% </div>
Feedback
is appreciated. I think this little feature is worthwhile putting into TWiki.
This functionality is useful for the TWiki.org server move which is currently in work; we can add a "please save your changes" message one hour before we turn off editing on the old server. Then we can show a "update is disabled on the old server, visit the new server at (new IP address)" while the DNS propagation is happening.
--
PeterThoeny - 10 Oct 2003
This is now in
TWikiAlphaRelease and at TWiki.org. Updated also
TWikiSkins and
SkinDeveloperFAQ.
For Skin developers: Add a
%BROADCASTMESSAGE%
at the beginning of your view template, and add the following to the "TWiki Platform Settings" of your
TWikiPreferences topic:
- Broadcast message for skins supporting a %BROADCASTMESSAGE% at the top of the page: (IMPORTANT: Set to empty message if not used; #Comment out unused messages)
- Set BROADCASTMESSAGE =
- #Set BROADCASTMESSAGE =
NOTE: Edit and Attach will be disabled today between 05:00 PM and 06:00 PM PDT (00:00 to 01:00 GMT) for a scheduled TWiki maintenance |
--
PeterThoeny - 12 Oct 2003
A suggestion: Impose to skin authors to embed the
%BROADCASTMESSAGE%
in their template with already-styled
html, so that authors of messages do not have to provide style, as they may conflict with the skin scheme.
e.g:
<style type='text/css'>
.broadcastmessage {
background: yellow; display:block;
border-style:solid;border-width: 2px;border-color:red;
}
.broadcastmessage strong {color: red}
</style>
...
<div class=broadcastmessage>%<nop>BROADCASTMESSAGE%</div>
So users will only have to add:
* Set BROADCASTMESSAGE = *NOTE:* Edit and Attach will be disabled today ...
--
ColasNahaboo "Mr
CSS :-)" - 12 Oct 2003
Good point Colas. I updated
TWikiSkins and this topic to reflect that. XHTMLized your example.
Style sheets can safely be used in most environments. Believe it or not, at my workplace still a considerable percentage of employees are using Netscape 4.7, those users would see just black text on white background!
--
PeterThoeny - 12 Oct 2003
I've just upgraded to TWiki20031108alpha.tar.gz, and every page now starts with "%BROADCASTMESSAGE%" text. I assume that it is not parsed for some reason. Can you advise what to check first?
--
DmitryDiskin - 10 Nov 2003
Please read the note "for Skin developers" I posted on 12 Oct 2003
--
PeterThoeny - 10 Nov 2003
Thanks. The reason of the above problem was an extra space character before '=' sign in my preferences page.
--
DmitryDiskin - 11 Nov 2003