Extension:DismissableSiteNotice

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
DismissableSiteNotice

Release status: stable

Implementation Skin
Description Allows users to close the sitenotice
Author(s) Brion Vibber (Brion VIBBERTalk)
Last version continuous updates
Database changes no
License GPLv2+
Download Download snapshot
Subversion [Help]

Browse source code
View code changes

log

Example Wikimedia sites
Wikia sites
Hooks used
SiteNoticeAfter

Check usage (experimental)
Bugs: list open list all report

The DismissableSiteNotice extension allows users to close the sitenotice, using cookies. When you add a new sitenotice and want everyone to see it, change the number on the created page MediaWiki:Sitenotice id by one (e.g. if it would be 5, you'd replace the page with the number 6 and so on).

[edit] Installation

  1. Download the files from SVN or download a snapshot (select your version of MediaWiki) and place the files under $IP/extensions/DismissableSiteNotice
  2. Add to the end of LocalSettings.php:
    require_once("$IP/extensions/DismissableSiteNotice/DismissableSiteNotice.php");
  3. Installation can now be verified through Special:Version on your wiki

[edit] Redisplay the sitenotice whenever sitenoticed edited

The default behavior allows the site notice to be updated without forcing people who have dismissed it to see it again. Some sites may not need this as they may never make tweaks, updates or corrections to existing notices.

The below code change redisplays the sitenotice whenever the mediawiki:sitenotice content is edited. This eliminates the need for the "sitenotice_id" message entirely.

In DismissableSiteNotice.php change the one line of extension code:

   $id = intval( $wgMajorSiteNoticeID ) . "." . intval( wfMsgForContent( 'sitenotice_id' ) );

to:

   $id = intval( $wgMajorSiteNoticeID ) . "." . crc32( wfMsgForContent( 'sitenotice' ) );



Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox