Open main menu

Extension:CategoryMultisort

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
Parameters
$wgCategoryMultisortSortkeySettings
efCategoryMultisortIntegrate()
Hooks used
ArticleDeleteComplete
CategoryPageView
GetPreferences
LoadExtensionSchemaUpdates
ParserBeforeTidy
ParserClearState
ParserFirstCallInit
User
Translate the CategoryMultisort extension if it is available at translatewiki.net
Check usage and version matrix.

Contents

What can this extension do?Edit

This extension allows categories to be viewed with different sortkeys.

UsageEdit

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 instructionsEdit

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.

InstallationEdit

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

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

Configuration parametersEdit

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