Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:U/doc: Difference between revisions

Template page
m +expl
No edit summary
 
(37 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{#ifeq:{{SUBJECTPAGENAME}}|{{SUBJECTSPACE}}:{{BASEPAGENAME}}|{{Heavily used template}}
|{{#ifeq:{{PAGENAME}}|U/main|{{Mbox
|text = The {{T0|U/main|+|case=l}} is a version of {{T0|U|+|case=l}}, with simplified code and two additional possible parameters to modify the link target: the namespace can be changed from "User:" to e.g. "User{{color|b|bg=#BFF|{{0}}talk}}:", and the username can be postfixed with e.g. "{{color|b|bg=#BFF|~commonswiki}}".<br>
With these possibilities the functionality of the templates {{T0|Ut}} resp. {{T0|Uw}} or {{T0|Uwt}} can be performed.
|type = message}}
}}}}
{{TemplateBox
{{TemplateBox
|1=1
|1=1
|1d=user name: it is recommended to define the user name.<br><small>If absent, the name is shown of the last editing user</small>
| 1label-en = Username
|1def=
| 1d-en = <nowiki/>
|1stat=
It is recommended to define the user name.
 
<small>If absent, the name is shown of the last editing user</small>
<nowiki/>
| 1d-td-en = It is recommended to define the user name.
| 1default = {{magic word|REVISIONUSER|code=1|nowrap=1}}
| 1def-td  = <nowiki>{{REVISIONUSER}}</nowiki>
| 1stat = suggested
| 1type = wiki-user-name
 
|2=2
|2=2
|2d=nick name: display text, may be formatted  
| 2label-en = Displayed text
|2def=
| 2d-en = May be formatted wikitext or html.
|2stat=
| 2def = <nowiki>{{{1}}}</nowiki>
| 2stat = optional-
| 2type = line
 
|3=3
|3=3
|3d=language code: for interwiki link. <small>If absent, link to user entry in the Commons</small>
| 3label-en = Interwiki prefix
|3def=
| 3d-en = language code: for interwiki link. <small>If absent, link to user entry in the Commons</small>
|3stat=
| 3d-td-en = Language code for an interwiki link. If absent, link to user entry in the Commons.
|name=U
| 3def =
|desc=Link to a user, either internal or interwiki
| 3stat = optional-
*For users ''without a user page'' you may link to their talk page with {{Tl|Ut}}.
 
*For links to users of the {{Wd||German}} Wikipedia choose the effective {{Tl|Ud}}.  
|4=4
| 4d-en = <nowiki/>
± ("+" or "-" sign) to precede the user name with the namespace <code>{{ns:2}}:</code>
 
:'''+''' ("plus" sign)  to make    <code>{{ns:2}}:</code> a part of the link
:'''-''' ("minus" sign) to precede <code>{{ns:2}}:</code> as plain text
 
(if ''both'' signs are specified, "+" is used and "-" is ignored)<br>
The +/- parameter can as well be specified with parameter 2 or 3.
<nowiki/>
| 4d-td-en = <nowiki/>
+ or -  to precede the user name with the namespace prefix “{{ns:2}}:”
 
;+ ("plus" sign)
: make “{{ns:2}}:” a part of the link.
;- ("minus" sign)
: precede “{{ns:2}}:” as plain text.
 
(if both signs are specified, "+" is used and "-" is ignored)
 
The +/- parameter can as well be specified with parameter 2 or 3.
<nowiki/>
| 4sv  = +/-
| 4stat = optional-
| 4type = string
 
|5=link
| 5d-en = specify <code>link=no</code> to suppress the link
| 5d-td-en = specify “link=no” to suppress the link
| 5av  = no
| 5stat = optional-
| 5type = string
 
|6=<nowiki/>
|6d-td=<nowiki/>
|6d=<br>''more parameters to format the namespace (when "+" or "-" is specified)''
: <small>» not every possible combination of parameter values is useful «</small>
<nowiki/>
|6def=<nowiki/>
|6def-td=
|6stat=optional-
 
|7=case
|7d=for formatting of the namespace:
* <code>case=l</code> display "{{lcfirst:{{ns:2}}}}" instead of "{{ns:2}}"
* <code>case=i</code> display the national translation, in general a link 
* <code>case=n</code> display the national translation without linking it
<nowiki/>
| 7sv  = l/i/n
| 7stat = optional-
| 7type = string
 
|8=i18n
| 8d = An {{W|ISO 630-1|ISO 639}} language code, to follow another translation then yours
: when parameter setting is <code>case=i</code> or <code>case=n</code>
<nowiki/>
| 8def  = {{int:lang}}
| 8stat = optional-
| 8type = string
 
|9    ={{#ifeq:{{PAGENAME}}|U/main|par1}}
|9d    ={{#ifeq:{{PAGENAME}}|U/main|Prefix, e.g. <code>talk</code> }}
|9stat ={{#ifeq:{{PAGENAME}}|U/main|optional-}}
|10    ={{#ifeq:{{PAGENAME}}|U/main|par2}}
|10d  ={{#ifeq:{{PAGENAME}}|U/main|Postfix, e.g. <code>~commonswiki</code> }}
|10stat={{#ifeq:{{PAGENAME}}|U/main|optional-}}
 
|name=<includeonly>{{PAGENAME}}</includeonly><noinclude>U</noinclude>
| desc-td = Link to a user, either internal or interwiki.
| desc-en = Link to a user, either internal or interwiki
*{{nobold|For users ''without a user page'' you may link to their talk page with {{Tl|Ut}}.}}
*{{nobold|For links to users of the {{Wd||German}} Wikipedia, use {{Tl|Ud}}.}}
|namespace=all
|namespace=all
|usergroup=all
|usergroup=all
|placement=
|placement=
|usage-notes=Many users own in the Commons just a User Talk page, but no User page.  
|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>
:The template {{Tl|Uc}} checks whether the user page exists, and links to it if yes.
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.
::Otherwise it checks whether the user talk page exists, and links to it if yes.
 
:::Otherwise it links to the special page "user contributions".
Another reason for a redlink may result of ''changing the user name'' by the postfix "~commonswiki".<br>
:If later the other pages are created, it prefers automatically the talk page or user page.
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.
:<small>Since existence checks are not possible in other Wikipedias, these checks are performed only when ''no language code'' is specified.</small>
 
Sometimes neither user page nor the user talk page exist on Commons.  
* 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 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.
: 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>
 
This template pings the mentioned user like a normal page link. To not ping the user, see {{tl|noping}}.
 
|seealso=
|seealso=
|setscats=
|setscats=
|example=
|type=linktemp
|lines=
|lines=
|shorthand=
|shorthand=
|relieson=
|relieson={{#switch:{{PAGENAME}}|U/main=|Main template code {{T2|U/main}}}}
}}
== Examples ==
Instead of <nowiki>[[User:Konstantinopoulosstephanopoulos|Konstantinopoulosstephanopoulos]]</nowiki><br>
write just <nowiki>{{U|Konstantinopoulosstephanopoulos}}</nowiki> {{0}}for the same output {{U|Konstantinopoulosstephanopoulos}}
 
Instead of <nowiki>[[User:Renamed user wfoeefkqoifeqofmcqm|Renamed user wfoeefkqoifeqofmcqm]]</nowiki><br>
write just <nowiki>{{U|Renamed user wfoeefkqoifeqofmcqm}}</nowiki> {{0}}for the same output {{U|Renamed user wfoeefkqoifeqofmcqm}}
 
A matter of {{U|W}}{{U|e}}{{U|i}}{{U|r}}{{U|d}} {{U|g}}{{U|a}}{{U|r}}{{U|b}}{{U|a}}{{U|g}}{{U|e}}.
|i18n-method = -
|i18n-desc=The template does not generate any localizable text;
with + or - always the ''namespace'' in English: "{{ns:2}}" is displayed; only in <br>
combination with <code>case=i</code> or <code>case=n</code> the namespace can be translated using the "{{T2|i18n/namespace|LangSwitch}}" construct (according to <code>lang</code>).<small>{{Lua|Module:LangSwitch}}</small>
{{namespace/display|t=<includeonly>{{PAGENAME}}</includeonly><noinclude>U</noinclude>|name=username
|par1={{#switch:{{PAGENAME}}|Ut|Uwt=&#32;talk}}|par2={{#switch:{{PAGENAME}}|Uw|Uwt=~commonswiki}}}}
 
| useTemplateData = 1
}}{{clr}}
<span style="float:right" class="editsection"><nowiki>[</nowiki>{{Edit-int|Commons:Link templates/User and user talk links}} <!-- user links --><nowiki>]</nowiki></span>
{{Commons:Link templates/User and user talk links}}
{{Commons:Link templates/User and user talk links}}


Line 37: Line 155:
[[Category:Username internal link templates|{{PAGENAME}}]]
[[Category:Username internal link templates|{{PAGENAME}}]]
[[Category:Interwiki link templates|{{PAGENAME}}]]
[[Category:Interwiki link templates|{{PAGENAME}}]]
{{#ifeq:{{PAGENAME}}|U|[[Category:One-letter templates| ]]}}
</includeonly>
</includeonly>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.