DiscussionTemplates permite a los usuarios dejar un mensaje en un muro de mensaje usando una plantilla.
Installation
Usage
Este script no funcionará sin la configuración adecuada. Hay 2 opciones de configuración disponibles:
templates: Objeto que tendrá tu lista de plantillas (llave que es la etiqueta, variable que es el objetoname, de la cual es el nombre de la plantilla -including el espacio de nombre-, ytitle, siendo el título del mensaje)wikiList: La Lista de las wikis que reemplazarán$WIKIcon (el placeholder representando tu plantilla), usando el formato'key': 'https://community.fandom.com/fr'. Esto no se requerirá si no estás usando el placeholder
$USER también es compatible, y es reemplazado con el nombre de usuario correspondiente al muro de mensaje dond estás dejando la plantilla.
Por ejemplo:
window.DiscussionTemplates = {
templates: {
'item-1': {
name: 'Template:Item 1',
title: 'Title 1'
},
'item-2': {
name: 'Template:Item-2',
title: 'This is title 2'
},
item3: {
name: 'Template:Name3',
title: 'Title2'
}
},
wikiList: {
de: 'https://example.fandom.com/de',
es: 'https://example-es.fandom.com',
fi: 'https://example.fandom.com/fi'
},
allowedGroups: ['sysop', 'rollback']
};
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'
]
});