Extension:CategoryOnUpload

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

Release status: stable

CategoryOnUpload Screenshot.png
Implementation User interface
Description Adds a selection box to the upload page for choosing a category.
Author(s) Robert Leverington (RobertLTalk)
Last version 1.1.1 (2011-03-24)
MediaWiki 1.16+, see here
License GNU General Public License 2.0 or later
Download Download snapshot
Subversion [Help]

Browse source code
View code changes

Parameters

$wgCategoryOnUploadDefault
$wgCategoryOnUploadAllowNone
$wgCategoryOnUploadList

Hooks used
UploadForm:initial

UploadForm:BeforeProcessing

Check usage (experimental)

The CategoryOnUpload extension adds a selection box to the upload page allowing users to choose a category.

Contents

[edit] Installation

  • Upload the files to the extensions/CategoryOnUpload/ directory within your wiki.
  • Add require_once( "$IP/extensions/CategoryOnUpload/CategoryOnUpload.php" ); to the end of your LocalSettings.php file.
  • Enjoy!

[edit] Usage

Select a category from the selection box when uploading a file, the category list will automatically be populated.

Some larger wikis may have a lot of categories, in this case an array can be define to limit to specific image categories.

$wgCategoryOnUploadList = array( 'Images', 'Featured Images' );

Note: Only the development version supports this feature!

[edit] Configuration

There are three configuration settings you can set:

$wgCategoryOnUploadDefault
Specifies the category which will be set by default. (Default: null)
$wgCategoryOnUploadAllowNone
Allow the user to choose not to use a category, either true or false. (Default: true)
$wgCategoryOnUploadList
Allow a select list of categories to be defined, rather than all, e.g. image categories (Default: null)

There are also two messages you can may wish to alter:

MediaWiki:categoryonupload-label
The label for the category selection box, displayed on the upload form.
MediaWiki:categoryonupload-none
The option text for specifying no category, defaults to a single hyphen.

[edit] Releases

Version Release date Comments
1.0 2008-06-24 Original version.
1.1.0 2009-07-18 Add variable for manually overriding the category list.
1.1.1 2011-03-24 wfLoadExtensionMessages() removed. Extension now requires MW 1.16+

[edit] Compatibility

  • 1.1.0 → MW 1.11.1 - MW 1.15.5
  • 1.1.1 → MW 1.16+
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox