FANDOM


InputUsername is a plugin that shows your username on the page where designated. It only works for logged-in users.

Installation

Usage

<span class="InputUsername">{{{1|&#8203;}}}</span>

Typically, this will be added as a template such as Template:USERNAME, which mimics existing magic words when added to a page, e.g. {{USERNAME}}. An example can be found on the Templates wiki.

Configuration

If a user wishes to disable the replacement on a particular wiki (for instance if it is being added in a confusing way), they can add

window.disableUsernameReplace = true;

to their personal common.js page and the script will be ignored without affecting other users.

window.UsernameReplaceSelector = '.custom';

can be used to add a selector to the script.

Whatever is between the "<span class="InputUsername">" and the "</span>" is the text to display if the current viewer isn't signed into an account.

Example

Hello, <span class="InputUsername">anonymous user</span>!

will output:

Hello, anonymous user!
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+