Extension:CategoryMultisort

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
CategoryMultisort

Release status: experimental

Implementation Parser function, User interface, Database
Description Allowing categories to be viewed with different sortkeys.
Author(s) Liangenttalk
MediaWiki 1.16+
License GPLv2
Download
Parameters

$wgCategoryMultisortSortkeySettings
efCategoryMultisortIntegrate()

Hooks used
LoadExtensionSchemaUpdates

ParserFirstCallInit
LanguageGetMagic
ParserClearState
ParserBeforeTidy
LinksUpdate
ArticleDeleteComplete
CategoryPageView
GetPreferences

Check usage (experimental)

Contents

[edit] What can this extension do?

This extension allows categories to be viewed with different sortkeys.

[edit] Usage

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

[edit] With integration (see below)

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

[edit] With and without integration (see below)

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

[edit] Download instructions

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.

[edit] Installation

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

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

[edit] Configuration parameters

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

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox