Extension:MediaUploader/Configuration/Details

MediaUploader has two very powerful features that allow you to build almost arbitrary forms for users and translate them into wikitext:
 * The ability to freely configure and reorder the fields in the Describe step (configured in the  section).
 * Setting up transformations from user input into wikitext (configured in the  section).

section
This section configures the fields shown in the Describe step. All fields shown there by default can be reordered or removed, and new ones can be added. Each field must have a unique key, such as. This key is later used for referring to the field's value when building the wikitext of the page (see the  section).

This section is simply a mapping from field key to field descriptor object. What settings can be configured for each field depends on the field type (see subsections below the example).


 * Default value – first two fields

Common field settings
These settings can be used on any field type.


 *   (string) – required. Must be one of the available types listed below.
 *   (integer) – required. Integer number indicating the order in which the fields should appear in the form, lowest to highest. The numbers don't have to be sequential (so you can have missing values in between).
 *   (string, parsed) – required. The main label of the field, shown in bold. The value of this setting is parsed.
 * (string, parsed) – optional. Help text displayed above the field, explaining the user how to use it. The value of this setting is parsed.
 * (string) – optional. This sets whether the user is forced to fill the field, is recommended to do that, or is completely free to decide. This field has three possible values:
 * – the user cannot progress without filling out this field.
 * – if the user hasn't filled out this field, they will be prompted before progressing further. The user can dismiss the prompt.
 * (default) – the user is not forced or prompted to fill out the field.
 * (boolean) – optional. Whether the field is visible to the user or not. The default is false.
 * (boolean) – optional. Whether the field can be edited by the user or not. The default is true.
 * (boolean) – optional. Whether the field should be moved to the bottom collapsible section titled by default Add location and more information... Use this for less important fields that you don't expect the users to use often. The default is false.
 * – default value for the field. If the field is  and not , the user can modify this default value. The type of this setting depends on the field type (see below).

Simple one-line text field.

Additional settings:
 * (string) – default content of the field
 * (integer) – minimum length in characters for user's input in this field
 * (integer) – maximum length in characters for user's input in this field
 * (boolean) – whether to try to automatically fill this field with the image's description extracted from metadata.


 * Example

Same as, but appears as a multi-line text field. Has the same settings.

Multi-line textbox with a language dropdown.

Additional settings:
 * (map) – map specifying the default language and the default text.
 * Fields:,  . Both fields are mandatory.
 * The language should be a valid ISO 646 language code.
 * (integer) – same as in the  field type
 * (integer) – same as in the  field type
 * (boolean) – same as in the  field type


 * Example

Multiple-valued, multi-line textbox. For each value, a different language can be selected. This is useful in multilingual wikis (such as Wikimedia Commons), where you want to allow users to describe the file in multiple languages.

Additional settings:
 * (array of maps) – an integer-indexed array, where each items corresponds to one language-text pair in the input. Each item in the array is configured just as the default value for the  field.
 * (integer) – same as in the  field type
 * (integer) – same as in the  field type
 * (boolean) – same as in the  field type


 * Example

Special field type used for inputting the title of the uploaded file. The input does not display the file's extension. There is additional validation in place to make sure the title can be used as the name of a page. There should only be one field of this type in the form.

Additional settings:
 * (string) – default value for the field
 * (integer) – same as in the  field type. 5 by default. It is not recommended to change this setting.
 * (integer) – same as in the  field type. 240 by default. It is not recommended to change this setting.
 * (boolean) – whether to automatically pre-fill the field based on the uploaded file's name


 * Example

Dropdown selection from a pre-defined list.

Additional settings:
 * (map) – list of available options. Maps the option's value to its displayed text (see example below).
 * (string) – default value for the field, must be one of the keys from the  setting.


 * Example

Combined popup calendar and free-form date input.

Additional settings:
 * (string) – default value for the field. The arbitrary input mode will be used.
 * (boolean) – whether to attempt to automatically pre-fill the field, based on the information in the image's EXIF.


 * Example

Special input for adding MediaWiki categories to the upload. Multiple categories can be selected by the user. The input suggests categories when the user types in it.

Additional settings:
 * (string) – if the user didn't add categories, or removed the default categories, add this wikitext. Use this to indicate that some human should categorize this file. Does not consider  categories, which are hidden.
 * (array of strings) – categories to automatically (and silently) add all uploaded images into. Category names here should not include the Category: prefix.
 * (array of strings) – categories to add to the category selection field by default (the user can remove them). Category names here should not include the Category: prefix.


 * Example

Compound field allowing the user to specify a geographic location: latitude, longitude, altitude, and heading. Each of the four parts of the field can be individually disabled.

Additional settings:
 * (array of strings) – which subfields to enable (show to the user).
 * Possible values:,  ,  ,
 * The default is latitude and longitude.
 * (map) – default value for each subfield. Subfields:
 * (float) – must be a number between -90 and 90.
 * (float) – must be a number between -180 and 180.
 * (float) – must be a number between 0 and 360.
 * (float) – any real number. Assumed to correspond to elevation above sea level in meters, although any other unit or reference point can also be used (it's a matter of UI labels).
 * (boolean) – whether to attempt to automatically pre-fill the field, based on the information in the image's EXIF.


 * Example

Special field type shown only when the user uploads several files at once, and in the Release rights step chooses the option to specify the license for each file separately. In such a case, in the Describe step, for each file a license choice must be displayed. You cannot configure the behavior of this field here (see: licensing configuration), but you can customize its label and position in the form.

There must be exactly one field of type license in the form. Otherwise, multi-file uploads may not work correctly.

All settings besides,  , and   will be ignored for this field type.


 * Example

Overriding settings in campaigns
See also: Default settings and overriding them

Because of the way the config overriding system works, to remove a field that is included in the default config (you can find it here), you must set the field in the  section to null.

So, for example, if you don't like the location field from the default config, disable it like so:

In a campaign you would do it similarly: