FANDOM


<insert name here>

Export this template, then import, to install it.
Use edit summary: Copied from [[w:c:templates:Template:USERNAME]] to properly attribute this template's editors.
This template is probably not already on your wiki.
Template documentation
Note: the template above may sometimes be partially or fully invisible.

View or edit this documentation. (How does this work?)

Editors can experiment with this template's sandbox and test case pages.
Description
Adds the username of the registered Fandom user who is viewing the page. If no user is logged in, the supplied alt text is displayed instead.
Syntax
{{USERNAME|alt text}}
Optional alt text is what is displayed when no user is logged in. If nothing is supplied as alt text, users will see "<insert name here>" when not logged in.
Examples
"<insert name here> is the best." will show "<insert name here> is the best."
If not logged in, you see… will show "<insert name here> is the best."
[[Special:Mypage|{{USERNAME|Visitor}}'s userpage is good too]]. will show "Visitor's userpage is good too."
If not logged in, you see… "Visitor's userpage is good too."
Dependencies
Add the following to the wiki's ImportJS file. This is preferred.
dev:InputUsername/code.js
Or add the following to the wiki's common js page.
importArticles({
    type: "script",
    articles: [
        "u:dev:MediaWiki:InputUsername/code.js"
    ]
});
See InputUsername on FANDOM Open Source Library for more information.
Community content is available under CC-BY-SA unless otherwise noted.