Template:U/doc: Difference between revisions
More actions
m precedence |
m expansion |
||
| Line 14: | Line 14: | ||
|4=4 | |4=4 | ||
|4d= | |4d= + or - to precede the user name with the namespace <code>{{ns:2}}:</code> | ||
:'''+''' ("plus" sign) to make <tt>User:</tt> a part of the link, | :'''+''' ("plus" sign) to make <tt>User:</tt> a part of the link, | ||
:'''-''' ("minus" sign) to precede <tt>User:</tt> as | :'''-''' ("minus" sign) to precede <tt>User:</tt> as plain text;<br> | ||
(if ''both'' signs are specified, "+" is used and "-" is ignored)<br> | (if ''both'' signs are specified, "+" is used and "-" is ignored)<br> | ||
The +/- parameter can as well be specified with parameter 2 or 3. | The +/- parameter can as well be specified with parameter 2 or 3. | ||
|4def= | |4def= | ||
|4stat=optional- | |4stat=optional- | ||
| Line 29: | Line 29: | ||
|usergroup=all | |usergroup=all | ||
|placement= | |placement= | ||
|usage-notes=Many | |usage-notes=Many users have only a ''User Talk page'' but no ''User page'' on Commons. This results in a ''red link'' when the user is mentioned using a standard <code><nowiki>{{user|UserName}}</nowiki></code> template.<br> | ||
An easy edit to fix this link is to | An easy edit to fix this link is just to change the <code><nowiki>{{U|</nowiki></code> to <code><nowiki>{{Ut|</nowiki></code> 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".<br> | Another reason for a redlink may result of ''changing the user name'' by the postfix "~commonswiki".<br> | ||
An easy edit to fix this link is to | An easy edit to fix this link is just to change it to <code><nowiki>{{Uw|</nowiki></code> to link to the new user page with the user name. | ||
Sometimes neither user page nor the user talk page exist on Commons. | Sometimes neither user page nor the user talk page exist on Commons. | ||
:The | :The {{T0|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 the user 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 links to the special page "user contributions" that lists the editor's contributions on Commons. | ||
| Line 47: | Line 47: | ||
|relieson= | |relieson= | ||
|i18n-method = - | |i18n-method = - | ||
|i18n-desc=The template does not generate any localizable text; | |||
with + or - always the ''namespace'' in English: "{{ns:2}}" is displayed. | |||
}} | }} | ||
Revision as of 06:14, 10 January 2018
Link to a user, either internal or interwiki
Usage
{{U |1= |2= }}
Many users have only a User Talk page but no User page on Commons. This results in a red link when the user is mentioned using a standard {{user|UserName}} template.
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 to the new user page with the user name.
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 links to the special page "user contributions" that lists the editor's contributions on Commons.
- 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.
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | user name: it is recommended to define the user name. If absent, the name is shown of the last editing user | empty | optional | |
2 | nick name: display text, may be formatted | empty | optional | |
3 | language code: for interwiki link. If absent, link to user entry in the Commons | empty | optional | |
4 | + or - to precede the user name with the namespace User:
(if both signs are specified, "+" is used and "-" is ignored) | empty | optional | |
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
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.
{{Commons:Link templates/User and user talk links}}