Extension:MsCatSelect

From mediawiki.org
MediaWiki extensions manual
MsCatSelect
Release status: unmaintained
Implementation User interface
Description Allows to add a page to an existing or newly creatable category via a drop-down list
Author(s) Martin Schwindl, Martin Keyler
Maintainer(s) Sophivorus
Latest version 7.2 (2021-04-10)
MediaWiki 1.29+
PHP 5.3+
License GNU General Public License 2.0 or later
Download
  • $wgMSCS_MainCategories
  • $wgMSCS_WarnNoCategoriesException
  • $wgMSCS_WarnNoCategories
  • $wgMSCS_UseNiceDropdown
Quarterly downloads 13 (Ranked 125th)
Translate the MsCatSelect extension if it is available at translatewiki.net
Issues Open tasks ¡ Report a bug

The MsCatSelect extension adds a visual interface to the edit page that allows you to:

  • Add a category to a page by selecting the category in a drop-down on the edit page.
  • Remove categories from a page
  • Define a custom list of categories
  • Set a specific sortkey for each category
  • Create a new subcategory in a selected category

Furthermore:

  • If you select a category in the drop-down list another drop-down will be created with all subcategories
  • The selected categories are received through the MediaWiki API
  • User-friendly select boxes with Chosen

Installation[edit]

  • Download and move the extracted MsCatSelect folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MsCatSelect
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'MsCatSelect' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration[edit]

$wgMSCS_MainCategories[edit]

Is an array filled with categories which should be loaded in the first drop-down. If this array is nonexistent all main categories (categories which are not subcategories) of the wiki are loaded automatically. Empty by default.

$wgMSCS_MainCategories = [
	'Cat1', // Don't include the 'Category:' namespace
	'Cat2',
    'Cat3'
];

$wgMSCS_WarnNoCategories[edit]

By default, if you try to save a page that has no categories assigned, MsCatSelect will ask for confirmation. If you wish to avoid this, set:

$wgMSCS_WarnNoCategories = false;

$wgMSCS_WarnNoCategoriesException[edit]

When $wgMSCS_WarnNoCategories is set to true, you may still want to avoid warnings in certain pages or namespaces. Add those pages and namespaces to the $wgMSCS_WarnNoCategoriesException array to do so. For example:

$wgMSCS_WarnNoCategoriesException = [ NS_TALK, NS_FILE_TALK, 'Main Page', 'Category:Whatever' ];

By default the array is empty. You can find all the namespace constants here.

API high limits[edit]

MsCatSelect uses the MediaWiki API, which returns a maximum of 500 subcategories for regular users. If some of your categories have more than 500 subcategories, set the following to overcome this limitation:

$wgGroupPermissions['*']['apihighlimits'] = true;

Usage[edit]

Once the extension is installed and configured, edit a page and scroll to the bottom to see the visual interface for adding or removing categories. Select the categories you want from the dropdown menus and save the changes to add the page to those categories.

Known bugs[edit]

  • phab:T221442 This extension can't handle pages with more than 10 categories. Pages with more than 10 categories will silently remove the exceeding number of categories when saving the page.

See also[edit]