Fandom Developers Wiki
Advertisement

DeezerWidget allows for the embedding of Deezer widgets into pages.

Installation

Usage

Create a template (e.g. Template:DeezerWidget) and add the contents of this page into it. From there, you may use it with the following:

{{DeezerWidget
|id = the ID of the music to be embedded
|width = the width size (without -px)
|height = the height size (without -px)
|autoplay = true / false (determines if the music does, or does not, automatically play)
|color = the hex code for the color of the widget's links, minus the #
|emptyPlayer = true / false (determines whether or not the widget displays)
|layout = light / dark
|playlist = true / false (determines if the widget does, or does not, display the songs)
|size = small / medium / big
|type = the format type of the music to be embedded
}}

For more information, you may refer to the widget's official Deezer documentation.

Configuration

It is possible to restrict usage of the autoplay option completely. What you need to do is insert the following code into your MediaWiki:Common.js:

window.DeezerWidgetDisableAutoplay = true;

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.

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'
    ]
});

Example

{{DeezerWidget
|id = 30595446
|width = 300
|height = 300
|color = 007FEB
|layout = dark
|size = small
|type = playlist
}}

Outputs:

Text above can be found here (edit)
Advertisement