Help:Gadgets

Gadgets deliver custom CSS or JavaScript to users who choose to use them. Unlike community CSS and JS, which are loaded for all users, gadget CSS and JS are only seen by users who enable the gadget. Gadgets are specific to each community; users can enable or disable them in their preferences under the "Gadgets" tab.



Gadgets are a way to provide users with optional site-wide experiences. However, keep in mind that anonymous users cannot enable gadgets or disable any gadgets set as enabled by default.

Requesting the extension
By default, most Fandom communities do not use gadgets. Gadgets are powered by an extension; any community that wishes to use gadgets must contact staff to request enabling the extension on that community.

List of gadgets
To view a community's list of gadgets, go to Special:Gadgets. This special page will also provide edit links for gadget descriptions, show a list of files used by each gadget, and show any rights required by each gadget. Note that you cannot enable or disable gadgets on this page; you must go to Special:Preferences to enable or disable which gadgets you use.

Wikis that do not have the Gadgets extension enabled will show an error page on Special:Gadgets, as it does not exist.

Gadget definition
The first step in creating a gadget is to define it. To do this, edit MediaWiki:Gadgets-definition on your community. Each gadget is defined by an entry in a bulleted list, so each line has to start with. The gadget definition formatting is as follows:


 * must be unique and is case-sensitive. It must start with a basic Latin letter and may be followed by any number of letters, digits, hyphens , underscores , colons , and periods.
 * See § Gadget options for an explanation on.
 * See § Gadget files for an explanation on,  , etc.

If your wiki has many gadgets, it may help to split the list into sections by using. For example, the following list of four gadgets is split into two sections: utilities and visual. Like gadget names, section headings are also case-sensitive and must be unique.

==utilities==
 * Utility1 [ResourceLoader] | NiceUtility.js
 * Utility2 [ResourceLoader|rights=rollback] | RollbackUtil.js | RollbackUtil.css

visual

 * Theme1 [type=styles] | CoolTheme.css
 * Theme2 [type=styles] | FireTheme.css

Gadget description
By default, users will see your gadget presented in Special:Preferences as. This is not a very helpful description. You can edit this description by going to MediaWiki:Gadget-gadget_name on your wiki. You can also go to the list of gadgets at Special:Gadgets and click the "Edit" link next to each gadget definition.

Gadget descriptions must be reasonable. A helpful description explains everything the user will see differently or gain access to if they enable the gadget. Remember that gadgets are about giving your users choices on modifying their experience. To do so, they need accurate information.

Section headings can also be edited to appear more user-friendly. In the above example, to edit the  heading, simply go to MediaWiki:Gadget-section-utilities or click the "Edit" link next to the section heading at Special:Gadgets.

Gadget options
A gadget definition can include options that further specify how to load the gadget or who can enable it. Each option must be separated by a  pipe character. Options that do not take any parameters, such as ResourceLoader, can simply be included on their own; options that do take parameters must be included with an equals sign followed by a comma-separated list of parameters, such as.

The table below lists the available gadget options for Fandom communities.

Gadget files
The bread and butter of a gadget are the files that it loads when it is enabled. Every CSS or JS page that a gadget loads must be prefixed with MediaWiki:Gadget-. In the above example, Utility2 defines two files, "RollbackUtil.js" and "RollbackUtil.css", which would be located at MediaWiki:Gadget-RollbackUtil.js and MediaWiki:Gadget-RollbackUtil.css, respectively. A good rule of thumb is to use the same name for the gadget and the files, but, as demonstrated, this is not a requirement.

Other than the Gadget- prefix, gadget CSS and JS files work like any other CSS or JS file. As such, please note that gadget JS files must be approved by the JavaScript review process before they are live for everyone. In terms of load order, gadgets are loaded after other local community code, but before personal code.

One gadget can load as many pages as desired, but it is rare to load more than one JS and one CSS page. Every file must be preceded in the gadget definition by a  pipe character. Any gadget CSS or JS page can also be loaded by multiple gadgets. Like other sidewide pages, gadgets can only be written using JS or CSS.

Further help and feedback
es:Ayuda:Gadgets fr:Aide:Gadgets ja:ヘルプ:ガジェット pl:Pomoc:Gadgets pt:Ajuda:Gadgets ru:Справка:Гаджеты tr:Yardım:Gadgetlar uk:Довідка:Гаджети zh:Help:小工具