Extension:CategoryMultisort
From MediaWiki.org
|
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 |
Download snapshot (Git master)
Git [?]: repo summary • tree • code changes SVN [?]: checkout-url • tree • code changes |
||
|
|||
|
|||
|
Check usage (experimental) |
|||
|
|
This extension may not work with MediaWiki 1.17+. |
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 );
- where SETTINGS is array( KEY => VALUE );
- KEY can be 'type' and set VALUE to 'int', or 'first' and set VALUE to an integer. See Extension:CategoryMultisortChinese.
- also add a wiki page MediaWiki:Categorymultisort-sortkey-name-SORTKEY and set it to a meaningful name.
- where SETTINGS is array( KEY => VALUE );
- efCategoryMultisortIntegrate();
- Call this if you want this extension to integrate into core category syntax. The experimental LinkHooks feature is used.
Categories:
- Experimental extensions
- Parser function extensions
- User interface extensions
- Database extensions
- Extensions in Wikimedia version control
- LoadExtensionSchemaUpdates extensions
- ParserFirstCallInit extensions
- LanguageGetMagic extensions
- ParserClearState extensions
- ParserBeforeTidy extensions
- LinksUpdate extensions
- ArticleDeleteComplete extensions
- CategoryPageView extensions
- GetPreferences extensions
- All extensions
- 2012 Q1 Extension Page Review Drive
