Extension:MsCatSelect

From Linux Web Expert

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
MediaWiki extensions manual
MsCatSelect
Release status: unmaintained
File:Mscatselect 1.jpg
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 Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
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

  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MsCatSelect</tvar>|Download]] and move the extracted <tvar name=name>MsCatSelect</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MsCatSelect
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'MsCatSelect' );
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Configuration

$wgMSCS_MainCategories

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

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

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

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

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

  • 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