Template:User link: Difference between revisions
 (Created page with "[[User:{{{1}}}|{{<includeonly>safesubst:</includeonly>#if:{{{2|}}}|{{{2}}}|{{{1}}}}}]]<noinclude> {{documentation}} <templatedata> { 	"params": { 		"1": { 			"label": "user name", 			"type": "wiki-user-name" 		}, 		"2": { 			"label": "user name different from text" 		} 	}, 	"format": "inline" } </templatedata> </noinclude>")  | 
			
(No difference) 
 | 
Latest revision as of 12:43, 17 September 2024
[[User:{{{1}}}|{{{1}}}]]
Usage
This template provides a way to link to a userpage and display just the username, like Template:Code2. This may not help much for a short username like "Example", but it can be more useful with long usernames such as Template:Code2.
Example
{{user link|Example}}
or the shortcut form
{{u|Example}}
gives
The template's second parameter, which is optional, takes the link's label; for example, a link to the long username used above can be shortened while viewing the text like this:
{{u|Guywhositsbehindphilip12|Guy}}
which gives
Alternative
The desired result can also be achieved using the pipe trick feature of the MediaWiki software. For example, the wikitext
[[User:Example|]]
gives
See also
No description.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| user name | 1 | no description  | User | optional | 
| user name different from text | 2 | no description  | Unknown | optional |