dev

Using configuration options with Fandom Developers Wiki scripts

The instructions on this page describe how to use configuration options with a script. Here on Fandom Developers Wiki, many scripts provide optional configuration settings as a means to alter or enhance the default behavior of the script. When installing configuration options in your JavaScript file, please note that they need to go above the import statement in order to work — unless the directions say otherwise. In case MediaWiki:ImportJS is used to load the scripts, it will be executed last.

Configuration options load too late, don't work
// 1. AjaxRC import statement
importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:AjaxRC.js'
    ]
});

// 2. AjaxRC configuration option
window.ajaxRefresh = 30000;
Proper placement of configuration options
// 1. AjaxRC configuration option
window.ajaxRefresh = 30000;

// 2. AjaxRC import statement
importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:AjaxRC.js'
    ]
});
Documentation icon Template documentation
[view] [edit] [history] [purge]

Note: parts of or the entire template might not be visible without values provided.
Description

Serves as a base template for localized versions of {{ConfigOptions}}, in order to avoid duplicating the entire template.

Syntax
<noinclude>{{languages}}</noinclude>{{ConfigOptions/base
|title = 
|intro = 
|bad-example-header = 
|good-example-header = 
|import-statement = 
|configuration-option = 
}}<noinclude>
[[Category:Article management templates]]
</noinclude>
English
<noinclude>{{languages}}</noinclude>{{ConfigOptions/base
|title = Using configuration options with {{SITENAME}} scripts
|intro = The instructions on this page describe how to use '''configuration options''' with a script. Here on the {{SITENAME}}, many scripts provide ''optional'' configuration settings as a mean to alter or enhance the default behavior of the script. When installing configuration options in your JavaScript file, please note that '''they need to go above the import statement''' in order to work — unless the directions say otherwise. In case <code>MediaWiki:ImportJS</code> is used to load the scripts, it will be [[w:Help:Including additional CSS and JS#Load_order|executed last]].
|bad-example-header = Configuration options load too late, don't work
|good-example-header = Proper placement of configuration options
|import-statement = AjaxRC import statement
|configuration-option = AjaxRC configuration option
}}<noinclude>
[[Category:Article management templates]]
</noinclude>