Template:U/doc: Difference between revisions
More actions
m format |
m format |
||
| Line 56: | Line 56: | ||
|usergroup=all | |usergroup=all | ||
|placement= | |placement= | ||
|usage-notes=Many users have only a ''User Talk page'' but no ''User page'' on Commons. This results in a ''red link'' | |usage-notes=Many users have only a ''User Talk page'' but no ''User page'' on Commons. This results in a ''red link'' with the standard linking <code><nowiki>[[User:UserName]]</nowiki></code>.<br> | ||
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. | 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 just to change it to <code><nowiki>{{Uw|</nowiki></code> to link | An easy edit to fix this link is just to change it to <code><nowiki>{{Uw|</nowiki></code> to link the new user page with the user name,<br>or to the talk page with <code><nowiki>{{Uwt|</nowiki></code> when only this one exists. | ||
Sometimes neither user page nor the user talk page exist on Commons. | Sometimes neither user page nor the user talk page exist on Commons. | ||
| Line 68: | Line 68: | ||
:If the other pages are created later, it automatically prefers the talk page over the user page. | :If the other pages are created later, it automatically prefers the talk page over the user page. | ||
:<small>Since existence checks are not possible in other Wikipedias, these checks are performed only when ''no language code'' is specified.</small> | :<small>Since existence checks are not possible in other Wikipedias, these checks are performed only when ''no language code'' is specified.</small> | ||
|seealso={{#ifeq:{{PAGENAME}}|U| | |seealso={{#ifeq:{{PAGENAME}}|U/main||Generalized template {{T0|U/main}}}} | ||
|setscats= | |setscats= | ||
|lines= | |lines= | ||
| Line 77: | Line 76: | ||
|i18n-method = - | |i18n-method = - | ||
|i18n-desc=The template does not generate any localizable text; | |i18n-desc=The template does not generate any localizable text; | ||
with + or - always the ''namespace'' in English: "{{ns:2}}" is displayed;<br> | with + or - always the ''namespace'' in English: "{{ns:2}}" is displayed; only in <br> | ||
combination with <tt>case=i</tt> or <tt>case=n</tt> the namespace can be translated using the "{{T2|i18n/namespace|LangSwitch}}" construct (according to <tt>lang</tt>).<small>{{Lua|Module:LangSwitch}}</small> | |||
{{namespace/display|t=<includeonly>{{PAGENAME}}</includeonly><noinclude>U</noinclude>|name=username}} | {{namespace/display|t=<includeonly>{{PAGENAME}}</includeonly><noinclude>U</noinclude>|name=username | ||
}} | |par1={{#switch:{{PAGENAME}}|Ut|Uwt= talk}}|par2={{#switch:{{PAGENAME}}|Uw|Uwt=~commonswiki}}}} | ||
}}{{clr}} | |||
{{Commons:Link templates/User and user talk links}} | {{Commons:Link templates/User and user talk links}} | ||
Revision as of 05:23, 30 May 2019
Link to a user, either internal or interwiki
Usage
{{U |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 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 wikitext or html | 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 | |
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 | |
lang | an ISO 639 language code, to follow another translation then yours
| en | 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
See also
Generalized template U/main
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
| Table: different displays for {{U}} with the namespace option | |
|---|---|
| {{ U | username }} this is the standard | username |
| {{ U | username | - }} | User:username |
| {{ U | username | - | case = l }} | user:username |
| {{ U | username | - | case = i }} | user:username |
| {{ U | username | - | case = n }} | user:username |
| {{ U | username | + }} | User:username |
| {{ U | username | + | case = l }} | user:username |
| {{ U | username | + | case = i }} | user:username |
| {{ U | username | + | case = n }} | user:username |
| {{ U | username | link = n }} | username |
| {{ U | username | - | link = n }} | User:username |
| {{ U | username | - | link = n | case = l }} | user:username |
| {{ U | username | - | link = n | case = i }} | user:username |
| {{ U | username | - | link = n | case = n }} | user:username |
| {{ U | username | + | link = n }} | User:username |
| {{ U | username | + | link = n | case = l }} | user:username |
| {{ U | username | + | link = n | case = i }} | user:username |
| {{ U | username | + | link = n | case = n }} | user:username |
{{Commons:Link templates/User and user talk links}}