Global Lua Modules/DynamicWelcome

DynamicWelcome is a module that extends the capability of Fandom's welcome tool. This allows for customized messages per administrator, per namespace (corresponding to an editor's first edit), and controlling the probability of which user will act as the greeter (see ).

Install
This module should be installed locally in a page titled Module:DynamicWelcome. Configuration modules will be accessed as subpages of this page and may not (as of yet) be configured for an alternate title.

The content of the page should comprise of:

Configuration
At this moment in time, there are not any default messages included. This module should be configured for the default before initial usage.

To configure custom messages, create a Module:DynamicWelcome/msg page. This page may be modified by creating literal nested tables, or using the  function of this module.

The content of the messages may be configured just the same as the default welcome tool (documentation here), but also allows the use of the pipe trick on message rendering (i.e. ).

Config by setup tool
This is the suggested method for creating messages, as it is arguably more readable.

To configure using the setup tool: 1. Import the setup function through 2. Define a message header, in this format: 3. Define whether the following messages are for users or anons. 4. Create a  message. 5. Create messages for other namespaces (if desired). 6. Generate message data with the  function. 7. Go back to step 3 to create messages for anons (for the current admin), or go back to step 2 to create messages for other admins.

8. Prepend a  (with a space) onto the last   statement in the page.


 * Example (expand to view)

Config by literals
This section is a work in progress.


 * Example (expand to view)

Usage
For basic implementation, place the following in your wiki's local MediaWiki:Welcome-message-wall-user (or MediaWiki:Welcome-message-user, if using user talk pages):
 * For message walls


 * For user talk pages

And place the following in MediaWiki:Welcome-message-wall-anon (or MediaWiki:Welcome-message-anon, if using user talk pages) for anonymous editors:
 * For message walls


 * For user talk pages

Selecting a greeter
This script is also able to select a user to act as a greeter, with associated probability weight. This functionality may be used with or without utilizing this script's primary functionality (the  page would still need to be partially configured however).

To enable this feature, place the following in your wiki's local MediaWiki:Welcome-user page:

Internal wikilink to external link
This script is also able to convert internal wikilinks (w/o brackets) to external links that target internal pages. This functionality is provided as to minimize welcome messages' impact on wiki's maintenance reports, such as Special:WantedPages (especially on wikis that are prone to frequent page deletions or page moves). This function is particularly useful (as opposed to utilizing the URL data magic words) for the  argument, which may return a result such as.

This function may be used within the module's associated  page, or independently without utilizing the primary functionality of this script. The function may be invoked through the following syntax: