(Created page with "{{documentation}} __NOEDITSECTION__ {{t|USERNAME}} displays the username of the user viewing the page. It relies on MediaWiki:Gadget-Username.js. If the user is not logged in, then the template will display <insert name here>. You can control the text by adding a parameter to the template with a value of the default text. For example, <code><nowiki>{{USERNAME|foo}}</nowiki></code> outputs "foo" if the user viewing it is not logged in. ==Usage== <pre>{{USERNAME|fal...") |
No edit summary |
||
Line 4: | Line 4: | ||
{{t|USERNAME}} displays the username of the user viewing the page. It relies on [[MediaWiki:Gadget-Username.js]]. |
{{t|USERNAME}} displays the username of the user viewing the page. It relies on [[MediaWiki:Gadget-Username.js]]. |
||
If the user is not logged in, then the template will display <insert name here>. You can control the text by adding a parameter to the template with a value of the default text. For example, <code><nowiki>{{USERNAME| |
If the user is not logged in, then the template will display <insert name here>. You can control the text by adding a parameter to the template with a value of the default text. For example, <code><nowiki>{{USERNAME|shahadat}}</nowiki></code> outputs "shahadat" if the user viewing it is not logged in. |
||
==Usage== |
==Usage== |
Latest revision as of 09:35, 22 October 2024
{{#seo:
|type = website |description = Template:USERNAME/doc is a template page used on the TCG Card Shop Simulator Wiki. Templates are pages that are embedded (transcluded) into other pages to allow for the repetition of information. |site_name = TCG Card Shop Simulator Wiki |locale = en }}
{{USERNAME}}
displays the username of the user viewing the page. It relies on MediaWiki:Gadget-Username.js.
If the user is not logged in, then the template will display <insert name here>. You can control the text by adding a parameter to the template with a value of the default text. For example, {{USERNAME|shahadat}}
outputs "shahadat" if the user viewing it is not logged in.
Usage
{{USERNAME|fallback (optional)|type=(optional)}}
The type
parameter is optional. If left blank, the placeholder text will be replaced with the viewer's wiki username (if logged in). If filled in with type=insertrsn
, the placeholder text will be replaced with the viewer's in-game username, which is retrieved from localStorage (assuming the viewer has entered it into one of our calculators before).
Examples
Code | Gives |
---|---|
{{USERNAME}}
|
<insert name here> |
{{USERNAME|Shahadat}}
|
Shahadat |
{{USERNAME|type=insertrsn}}
|
<insert name here> |
{{USERNAME|Shahadat|type=insertrsn}}
|
Shahadat |