Jump to content

Manual:Interface/Gadgets-definition

From mediawiki.org

MediaWiki:Gadgets-definition is the page which defines the gadgets available to users at Gadgets, a tab in Special:Preferences provided by Extension:Gadgets . For details, see Extension:Gadgets .

Format

[edit]

Each line on the MediaWiki:Gadgets-definition page should start with a "*" (asterisk) character to define a gadget. The line takes the following format:

* mygadget [options ] |page names

The first field ("mygadget" in the example) is the gadget's internal name. The label for the preferences page comes from an interface message page (MediaWiki:Gadget-mygadget) where the proper name and a short description can be written, which also allows wikitext markup to be used.

The internal name must begin with a basic Latin letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (-), underscores (_), and periods (.). The reason for this limitation is that the internal name must be valid as an HTML form name, a MediaWiki interface message key, and a ResourceLoader module name.

Options format:

[ option1 | option2 | ... optionN ]

Options that are "flags" only need to have their name written to be turned on. Options that need a value are followed by an equals sign and a comma-separated list of values. All whitespace is optional and may be omitted.

[ myflag | mykey = value1, value2, value3 ]

Examples:

* mygadget | mygadget.js | mygadget.css

or

* mygadget [ package ] | mygadget.js | mygadget-Foo.js | mygadget-data.json | mygadget-template.vue | mygadget.css

or

* mygadget [ rights = foo, bar ] | mygadget.js | mygadget.css


Sections

[edit]

Gadgets-definition can contain sections, but no distinction is made between different levels of headings. Headings are not used directly for display, but instead refer to a MediaWiki message for that section heading beginning with MediaWiki:Gadget-section-. So ==LanguageSupport== refers to MediaWiki:Gadget-section-LanguageSupport, and the content of that message (or of the localized subpages, MediaWiki:Gadget-section-LanguageSupport/de etc.) will be displayed to the user at Special:Preferences.