Расширение:CategorySortHeaders

From mediawiki.org
This page is a translated version of the page Extension:CategorySortHeaders and the translation is 25% complete.
Справка по расширениям MediaWiki
CategorySortHeaders
Статус релиза: стабильно
Реализация Хук
Описание Make custom headings in category pages, instead of just the first character headings
Автор(ы)
Последняя версия 0.4.0 (2021-04-20)
MediaWiki 1.35+
Изменения в БД Нет
Лицензия GNU General Public License 2.0 или позднее
Скачать

  • $wgCategorySortHeaderAppendPageNameToKey
Ежеквартальные загрузки 6 (Ranked 134th)
Переведите расширение CategorySortHeaders, если оно доступно на translatewiki.net

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^]].

Usage

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.

Установка

  • Скачайте и распакуйте файл(ы) в папку с названием CategorySortHeaders в вашей папке extensions/.
    Вместо этого разработчикам и соавторам кода следует установить расширение из 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)
  • Yes Готово – Перейдите на страницу 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.

Configuration

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

См. также