DiscordBanner adds a dynamic banner from Discord's API that links to a Discord server. It also displays the number of users online.
It can also be used with a template.
Installation
Configuration
Your server's ID is stored in MediaWiki:Custom-DiscordBanner-id. All other configuration options are stored in the window.DiscordBannerSettings
object.
Variable | Description | Default value | Allowed values | Required |
---|---|---|---|---|
bannerStyle
|
Banner's style | 3
|
1 , 2 , 3 , 4
|
X |
inviteLink
|
Link to Discord server | Vgfu9qb (Fandom Developers Wiki server)
|
Any Discord invite link (must be permanent and from server in Custom-DiscordBanner-id) | X |
prependToRail
|
Put the banner on top of the rail | true
|
true , false
|
|
noRail
|
Whether the rail module should be disabled | false
|
true , false
|
The following is an example configuration.
window.DiscordBannerSettings = {
bannerStyle: '2',
inviteLink: 'Vgfu9qb', // Fandom Developers Wiki, EXAMPLE CONFIGURATION
prependToRail: false
};
Using configuration options with Fandom Developers Wiki scripts
The instructions on this page describe how to use configuration options with a script. Here on the Fandom Developers Wiki, 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 MediaWiki:ImportJS
is used to load the scripts, it will be executed last.
// 1. AjaxRC import statement
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:AjaxRC.js'
]
});
// 2. AjaxRC configuration option
window.ajaxRefresh = 30000;
// 1. AjaxRC configuration option
window.ajaxRefresh = 30000;
// 2. AjaxRC import statement
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:AjaxRC.js'
]
});
Template configuration
Option | Type | What it changes | Default |
---|---|---|---|
id
|
String | Your server's ID. For more information on how to get your server's ID, please see here. This parameter is required. | N/A |
invite
|
String | The second half of your server's invite link. (discord.gg/Vgfu9qb ) This parameter is required. The invite must be permanent.
|
N/A |
style
|
String | The banner style. | N/A |
For example, the following would produce a working template for the Fandom International server:
{{DiscordBanner | id = 160718156787220480 | invite = CWbREjG | style = 2 }}
You are either viewing on FandomMobile or you disabled your JavaScript via browser.
FAQ
- How do I get my server's ID?
- Click on your server's name, go to Server Settings > Widget and copy the server ID. Detailed instructions here.
- What do the banner styles look like?
- The following are available Discord banners:
See also
- DiscordIntegrator - adds a widget to the rail/content
- DiscordModule - adds a module leading to a Discord server
- DiscordChat - adds a widget replacing the chat rail module