Extension:CategoryMultisort

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
CategoryMultisort
Release status: experimental
Implementation Parser function , User interface, Hook , Database
Description Allowing categories to be viewed with different sortkeys.
Author(s) Liangenttalk
MediaWiki 1.16+
License GPLv2
Download Template:WikimediaDownload/svn
$wgCategoryMultisortSortkeySettings
efCategoryMultisortIntegrate()
Translate the CategoryMultisort extension if it is available at translatewiki.net
Check usage and version matrix.

What can this extension do?[edit]

This extension allows categories to be viewed with different sortkeys.

Usage[edit]

Assume the sortkeys SKA, SKB, SKC are defined in LocalSettings.php (see below).

With integration (see below)[edit]

<code>
{{DEFAULTSORT:D}} -- The DEFAULTSORT syntax from core.
{{DEFAULTSORT:|SKA=1}} -- Set default SKA for all categories.
- or -
{{DEFAULTSORT:D|SKA=1}} -- You can put them together.

[[Category:Cat||SKB=2]] -- Leave the first argument alone. That's for the core sortkey; leaving blank means default.
</code>

With and without integration (see below)[edit]

<code>
{{DEFAULTSORT:D}} -- The DEFAULTSORT syntax from core.
{{#CategoryDefaultMultisort:SKA=1}} -- Set default SKA for all categories.
[[Category:Cat]] -- This must exist.
{{#CategoryMultisort:Cat|SKB=2}} -- Set SKB for this page in [[:Category:Cat]]
</code>

Download instructions[edit]

Please download the code and place it in $IP/extensions. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation[edit]

To install this extension, add the following to LocalSettings.php:

require_once("$IP/extensions/CategoryMultisort/CategoryMultisort.php");
# add configuration parameters here

Configuration parameters[edit]

  • $wgCategoryMultisortSortkeySettings = array( 'SORTKEY' => SETTINGS );
  • efCategoryMultisortIntegrate();
    • Call this if you want this extension to integrate into core category syntax. The experimental LinkHooks feature is used.