Help:Gadgets/options



This page explains some of the configuration options available for gadgets.

General set up
Gadget options are usually set in MediaWiki:Gadgets-definition. There, you use the following syntax, where each field is separated by pipes:



The first field sets up the internal name of the gadget. The other fields are  pages that will be loaded for the user. In the above example, mygadget:
 * has definition text at MediaWiki:Gadget-mygadget
 * will load MediaWiki:Gadget-mygadget.js and MediaWiki:Gadget-mygadget.css.

It's possible to configure options in the first field of your gadgets. For example:


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

Option format
[option1 | option2 | ... optionN] Whitespace can be omitted. The brackets are wrapped around either: option = value1, value2, value3
 * single option name (in this case it is a flag option), OR
 * contain a comma-separated list of values:

Available options
To make the gadget available only to users with appropriate permissions, set the  option. For example:


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


 * NOTE: Rights are not user groups. Declaring a user group will make the gadget accessible to no one. Instead, a user right must be declared from Special:ListGroupRights, and then all users who have access to that user right will be able to use the gadget. For example, declaring the  user right would make a gadget available to almost 10 different user groups, whereas   would make a gadget available to only one — the   user group.

Here are some other options:

Please don't use default option
While it is technically possible to set gadgets as, this option should not be used on Fandom.

That's because default gadgets display for unregistered users, and there's no way for these users to disable the gadget. Thus, you're taking away their choice to use the gadget. You're also reversing the gadget's logic for registered users; default gadgets must be turned off, instead of opted into. Both situations work against the main intent of the Gadgets extension.

If you want CSS or JS to apply to all users, please use the main JS and CSS pages on your wiki.