| 👁 Image | The is a version of template:U, with simplified code and two additional possible parameters to modify the link target: the namespace can be changed from "User:" to e.g. "User0talk:", and the username can be postfixed with e.g. "~commonswiki". With these possibilities the functionality of the templates Ut resp. Uw or Uwt can be performed. |
Link to a user, either internal or interwiki
Usage
{{U/main |1= }}
Many users have only a User Talk page but no User page on Commons. This results in a red link with the standard linking [[User:UserName]].
An easy edit to fix this link is just to change the {{U| to {{Ut| to link the user talk page with the user name.
Another reason for a redlink may result of changing the user name by the postfix "~commonswiki".
An easy edit to fix this link is just to change it to {{Uw| to link the new user page with the user name,
or to the talk page with {{Uwt| when only this one exists.
Sometimes neither user page nor the user talk page exist on Commons.
- The Template:Uc checks whether the user page exists, and links to it if yes.
- Otherwise it checks whether the user talk page exists, and links to it if yes.
- Otherwise it checks whether a user~commonswiki page exists, and links to it if yes..
- Otherwise it checks whether a user~commonswiki talk page exists, and links to it if yes..
- Otherwise it links to the special page "user contributions" that lists the editor's contributions on Commons.
- Otherwise it checks whether a user~commonswiki talk page exists, and links to it if yes..
- Otherwise it checks whether a user~commonswiki page exists, and links to it if yes..
- Otherwise it checks whether the user talk page exists, and links to it if yes.
- If the other pages are created later, it automatically prefers the talk page over the user page.
- Since existence checks are not possible in other Wikipedias, these checks are performed only when no language code is specified.
This template pings the mentioned user like a normal page link. To not ping the user, see {{Noping}}.
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | Username |
It is recommended to define the user name. If absent, the name is shown of the last editing user | {{REVISIONUSER}} | suggested |
2 | Displayed Text | May be formatted wikitext or html. | {{{1}}} | optional |
3 | Interwiki Prefix | language code: for interwiki link. If absent, link to user entry in the Commons | empty | optional |
4 |
± ("+" or "-" sign) to precede the user name with the namespace
(if both signs are specified, "+" is used and "-" is ignored) | empty | optional | |
link | specify link=no to suppress the link | empty | optional | |
| more parameters to format the namespace (when "+" or "-" is specified)
| optional | ||
case | for formatting of the namespace:
| empty | optional | |
i18n | An ISO 639 language code, to follow another translation then yours
| en | optional | |
par1 | Prefix, e.g. talk | empty | optional | |
par2 | Postfix, e.g. ~commonswiki | empty | optional | |
|
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.
Wikipedia's help about TemplateData • Commons-specific information
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Relies on:
Examples
Instead of [[User:Konstantinopoulosstephanopoulos|Konstantinopoulosstephanopoulos]]
write just {{U|Konstantinopoulosstephanopoulos}} 0for the same output Konstantinopoulosstephanopoulos
Instead of [[User:Renamed user wfoeefkqoifeqofmcqm|Renamed user wfoeefkqoifeqofmcqm]]
write just {{U|Renamed user wfoeefkqoifeqofmcqm}} 0for the same output Renamed user wfoeefkqoifeqofmcqm
Localization
This template is not intended to be localized.
The template does not generate any localizable text;
with + or - always the namespace in English: "User" is displayed; only in
case=i or case=n the namespace can be translated using the "{{LangSwitch}}" construct (according to lang).| 👁 Lua logo | Uses Lua: |
| Table: different displays for {{}} with the namespace option 0 | |
|---|---|
| {{ | username }} 0this is the standard | username |
| {{ U/main | username | - }} | User:username |
| {{ U/main | username | - | case = l }} | user:username |
| {{ U/main | username | - | case = i }} | LangSwitch Error: no default:username |
| {{ U/main | username | - | case = n }} | user:username |
| {{ U/main | username | + }} | User:username |
| {{ U/main | username | + | case = l }} | user:username |
| {{ U/main | username | + | case = i }} | user:username |
| {{ U/main | username | + | case = n }} | user:username |
| {{ U/main | username | link = n }} | username |
| {{ U/main | username | - | link = n }} | User:username |
| {{ U/main | username | - | link = n | case = l }} | user:username |
| {{ U/main | username | - | link = n | case = i }} | LangSwitch Error: no default:username |
| {{ U/main | username | - | link = n | case = n }} | user:username |
| {{ U/main | username | + | link = n }} | User:username |
| {{ U/main | username | + | link = n | case = l }} | user:username |
| {{ U/main | username | + | link = n | case = i }} | LangSwitch Error: no default:username |
| {{ U/main | username | + | link = n | case = n }} | user:username |
[edit ]
User and user talk links
| Code | Result | [1] | Shortcut |
|---|---|---|---|
|
{{|Example}} |
Example links to user page | ✔ | |
|
{{|Example}} |
Example conditional link to contributions page | ✔ | |
|
{{|Example}} |
Example links to German user page | = | |
| {{Ue|Example}} | Example links to English user page (not yet a template) | = | |
|
{{|Example}} |
Example does not link to user page; no echo function | – | |
|
{{|Example}} |
Example links to user talk page | ✔ | |
|
{{|Example}} |
Example trails the given name with "~commonswiki" | – | |
|
{{|Example}} |
Example links to the talk page of "~commonswiki" user | – | |
|
{{|Example}} |
Example Lua based list of one or more users | ✔ | {{ Ul }} |
| WWW Combinations: | |||
|
{{|Example}} |
Example (talk) — Customizable template | ✔ | |
|
{{|Example}} |
Example (talk) | ✔ | |
|
{{|Example}} |
Example (talk · contribs) | ✔ | |
|
{{|Example|:en:}} |
:en:Example (talk | contribs) | ~ | |
|
{{|Example}} |
Example (talk · contributions · Statistics) | ✔ | |
|
{{|Example}} |
Example (talk · contributions · Move log · block log · uploads · Abuse filter log) block user | ✔ | {{Vandal}} |
|
{{|Example}} |
Example ( local | logs | global ) | – | |
|
{{|Example}} |
Example (talk · contributions · Statistics · Recent activity · block log · User rights log · uploads · Global account information) (assign permissions) | – | |
|
{{|Example}} |
Example (talk · contributions · Move log · Statistics · logs · block log) | ✔ | |
|
{{|Example}} |
Example (talk · contributions · user rights management) | ✔ | |
|
{{|Example}} |
Example (talk • contribs • block log • filter log) | – | |
|
{{|Example}} |
Example (talk · contribs · logs · block log) | – | |
|
{{|Example}} |
Example (talk · contributions (views) · deleted user contributions · deleted uploads · recent activity (talk · project · deletion requests) · logs · block log · global contribs · CentralAuth) | – | |
|
{{|Example}} |
Example (talk · contribs · count · global contribs) | ✔ | |
|
{{|Example}} |
Example (talk · contribs · deleted contribs · logs · edit filter log · block user · block log) | ✔ | |
|
{{|Example}} |
Example (talk • contribs • blocks • protections • deletions • moves • rights • rights changes) | – | {{ A }} |
|
{{|Example}} |
Example (talk • contribs • rename user) | – | |
|
{{|Example}} |
Example (contribs) | – | |
|
{{|Example}} |
tasks • contribs • count • logs • page moves • block user • block log • flag log • global contribs • flag bot | – | |
|
{{|Example}} |
Example (talk • contribs • Luxo • SUL • deleted contribs • logs • block user • block log • checkuser) | – | |
- ↑ Interwiki template: Interwiki access (with 3=language code)
Be aware that other templates may use the parameter "editor" or "by" for the same purpose.
