Extension:DismissableSiteNotice

This page is a translated version of the page Extension:DismissableSiteNotice and the translation is 45% complete.
MediaWiki 拡張機能マニュアル
DismissableSiteNotice
リリースの状態: 安定
実装 外装 , 自分のウィキ
説明 利用者が通知を終了できるようにする
作者 Brooke Vibberトーク
最新バージョン continuous updates
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki >= 1.42
データベースの変更 いいえ
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
  • $wgMajorSiteNoticeID
  • $wgDismissableSiteNoticeForAnons
Quarterly downloads 42 (Ranked 107th)
Public wikis using 2,711 (Ranked 188th)
translatewiki.net で翻訳を利用できる場合は、DismissableSiteNotice 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

DismissableSiteNotice拡張機能は、Cookieを使ってユーザーがSitenoticeを閉じることができるようにします。

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のDismissableSiteNoticeという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/DismissableSiteNotice
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'DismissableSiteNotice' );
    
  • 必要に応じて設定します。
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

設定

This extension provides two configuration parameters:

$wgMajorSiteNoticeID
整数。 The value is stored inside a cookie. When a user decides to close the sitenotice, the current value of $wgMajorSiteNoticeID is saved as well and the closed notice is not shown again. $wgMajorSiteNoticeID now can be incremented when a new text is set up as sitenotice. If $wgMajorSiteNoticeID has inbetween been incremented, then the sitenotice is shown again, even if the user closed an older sitenotice before.
$wgDismissableSiteNoticeForAnons
This allows to set whether or not it should be possible for anonymous visitors of the wiki to dismiss the sitenotice shown. 既定値は "false" です。 Available for MW 1.25 +

使用法

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).

The extension behavior is that it will remember the dismissal by the user and only reset after the number in MediaWiki:Sitenotice_id has been raised. This allows a wiki to make minor updates to a notice without causing it to show again for everybody.