WelcomeMessage detects a user’s first-ever edit and posts a configurable greeting. It tries the Fandom Message Wall first and automatically falls back to User talk if Walls aren’t available. Admins set text and variables from their own wiki’s JS after importing the script.
Installation
Configuration
Set options on your wiki before import using window.welcomeMessage. All fields are optional; defaults are used when omitted.
enabled(Boolean): turn on/off (defaulttrue)adminUsername(String): admin's username (defaultAdmin)adminNickname(String): admin's display name (defaultAdmin)messageTitle(String): message title (defaultWelcome, $1!)messageText(String): message body; if blank, a short but encompasing default is useddebug(Boolean): shows all console logs available (defaultfalse)testAllEdits(Boolean): post on every save for testing (defaultfalse).
Warning: only for use in personal JS; if used site-wide, will trigger on every user's every edit.preferTalk(Boolean): force sending messages to talk page vs MessageWall (defaultfalse)
Template variables available in title/body: $1 user username, $2 page edited, $3 admin nickname, $4 admin username.
Usage
Add your settings with window.welcomeMessage = { ... } before the import, or omit to use defaults.
Import the script with importArticles({ type: 'script', articles: ['dev:MediaWiki:WelcomeMessage.js'] }).
Example
// Optional config — leave blank to use defaults
window.welcomeMessage = {
enabled: true,
adminUsername: 'ExampleAdmin', // $4
adminNickname: 'Example Admin', // $3
messageTitle: 'Welcome, $1!',
messageText: 'Hey $1 — I\'m $3.\n\nThanks for your first edit on <a href="wikiurl.fandom.com/wiki/$2">$2</a>.\n\n— $3',
debug: false,
testAllEdits: false,
preferTalk: false,
};
// Import from dev
importArticles({
type: 'script',
articles: [
'dev:MediaWiki:WelcomeMessage.js'
]
});
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'
]
});
Planned updates
- Fix link display on talk pages
- Make setup through special pages vs mw so as to bypass any coding knowledge being needed, as well as the review period.