Extension:UploadFields

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
UploadFields
Release status: stable
Implementation User interface, Media
Description Adds a parser function called #ev for embedding video clips from popular video sharing services.
Author(s) Alexia E. Smith (Alexia E. Smith)
Latest version 0.0.3 (2018-11-08)
MediaWiki 1.30+
PHP 7.0+
License GNU General Public License 2.0 or later
Download
Translate the UploadFields extension if it is available at translatewiki.net
Check usage and version matrix.
Vagrant role UploadFields

The UploadFields Extension is a MediaWiki extension which allows the configuration of custom upload fields to be added to the Special:Upload page. Information from those custom fields is then added to the Template:FileInfo template on the file page.

Project Homepage
Documentation at Github
Source Code
Source code at Github
Bugs
issues at Github
Licensing
UploadFields is GPL-2.0+ Copyright 2017 Curse


Installation[edit]

  • Download, extract and place the file(s) in a directory called UploadFields in your extensions/ folder.

Usage[edit]

To create a new upload field start by creating a new page in the MediaWiki namespace.

The format of the page name is: UploadField-field_type-Name

Valid types are:

  • select - Select drop down. Supports option groups down to two depths.
  • multiselect - Series of check boxes for multiple selection. Supports option groups down to two depths.
  • text - Single line text input.
  • textarea - Multiple line text input.
  • category - Display a multiple select drop down of existing categories on the wiki.

If you wanted a drop down HTML select field named "Game" you would create the definition page: MediaWiki:UploadField-select-Game

Field Types[edit]

select and multiselect[edit]

These two types support two levels deep of listed options which is limited due to HTML specifications. Simply make a standard unordered list up to ** deep. Any blank lines and lines not starting with * with be ignored.

Each selection value should be in the format of: TemplateValue|Label Name

* Main Series
** Part1|This Amazing Game Part 1
** Part2|This Amazing Game Part 2

* Combinations
** CE|Collector's Edition

Example: Selecting "This Amazing Game Part 1" from the "Game" field when uploading a new image would result in "Game=Part1" being added to the FileInfo template.

{{FileInfo
|Game=Part1
}}

text and textarea[edit]

The text and textarea types add their respective single line or multiple line text fields to the upload form. The content of the MediaWiki:UploadField-text(area)-Name definition page will be filled in as a default value and can be left blank.

category[edit]

The category type produces a multiple select check box list of existing wiki categories to choose from. There is no filtering and any content added to the MediaWiki:UploadField-category-Name definition page will be ignored.