Community Central
Community Central
m (→‎See also: Mass editing of links)
Tag: Help
(Interwiki Link: +fr.)
Line 61: Line 61:
 
*[[Help:Extensions]] - A guide to all the extensions Fandom offers
 
*[[Help:Extensions]] - A guide to all the extensions Fandom offers
   
  +
[[fr:Aide:Gadgets/options]]
 
[[tr:Yardım:Gadgetlar/seçenekler]]
 
[[tr:Yardım:Gadgetlar/seçenekler]]
 
[[Category:Help]]
 
[[Category:Help]]

Revision as of 18:37, 19 September 2020

Gadgets-special

Special:Gadgets

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:

mygadget|mygadget.js|mygadget.css

The first field sets up the internal name of the gadget. The other fields are MediaWiki:Gadget-* pages that will be loaded for the user. In the above example, mygadget:

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:

  • single option name (in this case it is a flag option), OR
  • contain a comma-separated list of values:
option = value1, value2, value3

Available options

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

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

Here are some other options:

Name Parameters Description
ResourceLoader None Marks gadget's scripts as compatible with ResourceLoader.
dependencies Comma-separated ResourceLoader module names Note that this option has no effect if current gadget has no ResourceLoader-compatible resources (i.e. no styles and scripts not marked as compatible).
rights Comma-separated privilege names Disable the gadget (and make it invisible in preferences) for users who do not have these privileges.

Please don't use default option

While it is technically possible to set gadgets as default, 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.

References

This page contains content sourced from MediaWiki.org (CC-BY-SA).

See also