Template:Discord/doc
Jump to navigation
Jump to search
This template allows you to either use DiscordCompact or DiscordWidget to display information about a certain Discord server.
To use it, simply add the template with the server ID either as the first parameter or as the
{
"params": {
"1": {
"aliases": [
"id"
],
"label": "Server ID",
"description": "The Discord server's ID.",
"example": "951501892553424917",
"type": "line",
"required": true
},
"full": {
"label": "Use full widget",
"example": "yes",
"type": "boolean",
"description": "Do you want to use the full widget?"
},
"width": {
"label": "Width (full widget only)",
"description": "A custom width for the full widget.",
"example": "300px",
"type": "line"
},
"height": {
"label": "Height (full widget only)",
"description": "A custom height for the full widget.",
"example": "500px",
"type": "line"
}
},
"description": "This template allows you to either use DiscordCompact or DiscordWidget to display information about a certain Discord server.",
"paramOrder": [
"1",
"full",
"width",
"height"
],
"format": "block"
}
Usage
In order to be able to show a Discord server widget on your wiki, first go to your Discord server and do the following:- Open the
Server Settings, then go to theEngagementsection. - Scroll down to
Server Widget. - Enable the widget.
- Copy the
Server ID.
Compact widget (default)
Main article: DiscordCompact, [[]] and [[]]
The compact widget is the default one.
To use it, simply add the template with the server ID either as the first parameter or as the
id parameter:
{{Discord|serverID}} {{Discord|id=serverID}}
Full widget
Main article: DiscordWidget, [[]] and [[]]
To use the full version of the Discord widget, you have to specify full=yes as one of the template parameters, with the ID either as the first parameter or as the id parameter:
{{Discord|serverID|full=yes}} {{Discord|full=yes|id=serverID}}
width, height and other parameters. See the Examples section and the full documentation for DiscordWidget on the Support Wiki.
Examples
| Code | Result | ||
|---|---|---|---|
| |||
| |||
| id = 951501892553424917 | width = 300px | height = 500px}} || |
Dependencies
- As stated before, both Compact and Widget require the given Discord server to have Widgets enabled in its Server Settings.
- Both Compact and Widget require the
discordTemplategadget: - MediaWiki:Gadgets/discordTemplate
- MediaWiki:Gadgets/discordTemplate/main.js