Fandom Developers Wiki
Advertisement

AutoCreateUserPages allows automatically creating your own userpage and talkpage on wikis which you have contributed to at least once, whether by editing or posting a message, comment or Discussions post. It was originally made with personal-only use in mind, however, many wikis started using it sitewidely in lieu of a welcome tool.

Installation

Configuration

Configuration options for this script are stored under a global window.AutoCreateUserPagesConfig object. The following options are available:

  • content: Content that should be placed on the user pages. If set to a string, that content will be placed on both the userpage and talkpage (if talkpages are enabled). If set to an object, its 2 (for userpage) and 3 (for talkpage) properties are read to decide which content should be placed on which page. You can use a $1 variable in the content, which will be replaced by the name of the user that is editing the page. By default, this property has the value of {{w:User:$1}}.
  • summary: Summary to use while editing the user pages. By default set to "Auto creating user page".
  • notify: If set to true, this will notify the user that their user pages have finished creating. If set to a string, the user will be notified using that string as a message. You can use $1 and $2 variables in this string for the current user's name and their URL-encoded name, respectively. Some wikis may use this option as a kind of welcome message.

The script also fires a AutoCreateUserPages.loaded hook when all pages are created, with the array of created page names as the argument, in case developers want to execute further actions on these after their creation.

Example

The following configuration, for a user named User1, will create pages User:User1 and User talk:User1 (on a wiki with talkpages enabled) once they make their first edit or post, where the userpage will be created with {{:w:User:User1}} and the talkpage will be created with {{:w:User:User1/talk}}, and the user will be notified with a link to their userpage. The summary used when creating the page will be "Creating my pages".

window.AutoCreateUserPagesConfig = {
    content: {
        2: '{{:w:User:User1}}',
        3: '{{:w:User:User1/talk}}'
    },
    summary: 'Creating my pages',
    notify: '<a href="/wiki/User:$2">Here is a link to your userpage, $1!</a>'
};
Text above can be found here (edit)
Advertisement