Jump to content

Template:Add file description

From mediawiki.org
Template documentation

This template inserts a tool for adding descriptions to files in Wikimedia Commons.

This tool only edits Wikimedia Commons, but can be used from any wiki. See the installation instructions to get it working in your wiki.

Usage

[edit]
{{Add file description|History of Argentina}}
Loading...

Installation

[edit]

To install this template in your wiki:

  1. Create a template with the following markup. You can choose the template name, parameter names and defaults to suit your wiki.
    <includeonly><div class="AddFileDescription" data-category="{{{category|{{{1|}}}}}}" data-group="{{{group|}}}">Loading...</div>[[Category:Gadget:AddFileDescription]]</includeonly>
    
  2. Create MediaWiki:Gadget-AddFileDescription.js with the following code:
    /**
     * AddFileDescription is a tool for adding descriptions to files in Wikimedia Commons
     * Documentation: https://www.mediawiki.org/wiki/AddFileDescription
     * Source code: https://www.mediawiki.org/wiki/MediaWiki:Gadget-Global-AddFileDescription.js
     */
    mw.loader.load( '//www.mediawiki.org/w/load.php?modules=ext.gadget.Global-AddFileDescription' );
    
  3. Add the following gadget to MediaWiki:Gadgets-definition:
    * AddFileDescription[ResourceLoader|hidden|default|categories=Gadget:AddFileDescription]|AddFileDescription.js
    

Done! Add your template to any page to verify that the installation was successful.

Localization

[edit]

To help localize the messages of the interface, edit Commons:Data:Gadget-AddFileDescription.tab.

Template data

[edit]

This template inserts a tool for adding descriptions to files in Wikimedia Commons.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Categorycategory 1

Category page (with no prefix) on Wikimedia Commons where to get the files

Example
History of Argentina
Page namerequired
Groupgroup

User group to which to limit the use of the tool

Example
autoconfirmed
Stringoptional

See also

[edit]