Extension:CategoryTagSorter

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
CategoryTagSorter
Release status: stable
Implementation User interface, MyWiki
Description Alphabetizes category links at the bottom of an article
Author(s)
Latest version 0.4.0 (2018-02-05)
MediaWiki >=1.29
PHP 5.3+
Database changes No
License Apache License 2.0
Download
Hooks used
ParserBeforeTidy
GetPreferences
UnitTestsList
Translate the CategoryTagSorter extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

The CategoryTagSorter extension alphabetizes category links at the bottom of an article.

Description[edit]

A MediaWiki article typically displays the list of category links in the order in which they appear in the article. For articles with many categories, it can be difficult for readers to find the category they're looking for. This extension fixes this by alphabetizing category links.

Sorting is ascii-betical, which usually works out OK as most wikis are configured to have the first letter of a title be uppercase (see $wgCapitalLinks.)

This extension includes a user preference for individuals who prefer MediaWiki's default behavior.

Installation[edit]

  • Download and place the file(s) in a directory called CategoryTagSorter in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'CategoryTagSorter' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'CategoryTagSorter' );, you need to use:

require_once "$IP/extensions/CategoryTagSorter/CategoryTagSorter.php";

User preference option[edit]

This extension provides a user-preference option added in the Appearance section which allows users to turn off the alphabetizing of the categories. By default this extension is enabled. To set the default behavior to disabled (a opt-in type of extension), set the categorysortdisabled preference to 1 in the default user preferences.[1] Like so:

$wgDefaultUserOptions['categorysortdisable'] = 1;

References[edit]

  1. Thanks goes to Matma Rex for this trick.

See also[edit]