Extension:CategorySortHeaders

This page is a translated version of the page Extension:CategorySortHeaders and the translation is 50% complete.
MediaWiki 拡張機能マニュアル
CategorySortHeaders
リリースの状態: 安定
実装 フック
説明 カテゴリページの見出しを1文字目だけでなく、カスタム見出しにすることが可能
作者
最新バージョン 0.4.0 (2021-04-20)
MediaWiki 1.35+
データベースの変更 いいえ
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード

  • $wgCategorySortHeaderAppendPageNameToKey
Quarterly downloads 7 (Ranked 140th)
translatewiki.net で翻訳を利用できる場合は、CategorySortHeaders 拡張機能の翻訳にご協力ください

The CategorySortHeaders extension to allow specifying custom multi-character 'first-character' sorting headers to list pages under in categories, using syntax like [[Category:Foo|^Header^Invisible part of sortkey]] or even just [[Category:Foo|^Header^]].

使用法

If you want a category to use a custom header, do [[Category:Cat name|^header^OptionalInvisibleSortkey]] (or {{DEFAULTSORT:^header^Optionalsortkey}}. If you want to use the default first letter headers, just use categories as normal.

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のCategorySortHeadersという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CategorySortHeaders
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'CategorySortHeaders' );
    
  • Run either update.php or updateCollation.php from the command line (Note that running the web installer in upgrade mode does not work due to タスク T19335)
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

MediaWiki 1.35以前を稼働させている利用者へ:

上記の手順では、wfLoadExtension()を使用してこの拡張機能をインストールする新しい方法を記載しています。 この拡張機能をこれらの過去のバージョン (MediaWiki 1.35以前) にインストールする必要がある場合は、wfLoadExtension( 'CategorySortHeaders' );の代わりに以下を使用する必要があります:

require_once "$IP/extensions/CategorySortHeaders/CategorySortHeaders.php";
  警告: Do not set $wgCategoryCollation in LocalSettings.php . This extension defines its own collation, and must use that.

設定

This extension has a single configuration option:

$wgCategorySortHeaderAppendPageNameToKey
It defaults to true, which causes a sortkey of ^foo^ to be treated like ^foo^{{PAGENAME}}. If it is set to false, it will sort ^foo^ above ^foo^<any string here>. (In both cases, if there are two exactly same sort keys, the pagename will be used as a tie breaker.) After changing this option you should run:
php updateCollation.php --force
If anyone likes the idea of this extension, but wants to use the uca-default collation instead of uppercase - let me (bawolff) know. It probably wouldn't be very difficult to modify this extension to make it work with uca-default

関連項目