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 linkfix
No edit summary
 
(26 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{#ifeq:{{BASEPAGENAME}}|U|{{Heavily used template}}}}
{{#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 wikitext or html
| 2label-en = Displayed text
|2def=
| 2d-en = May be formatted wikitext or html.
|2stat=optional-
| 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=optional-
| 3d-td-en = Language code for an interwiki link. If absent, link to user entry in the Commons.
| 3def =
| 3stat = optional-


|4=4
|4=4
|4d= + or - to precede the user name with the namespace <code>{{ns:2}}:</code>
| 4d-en = <nowiki/>
:'''+''' ("plus" sign)  to make <tt>User:</tt> a part of the link,
± ("+" or "-" sign) to precede the user name with the namespace <code>{{ns:2}}:</code>
:'''-''' ("minus" sign) to precede <tt>User:</tt> as plain text;<br>
 
:'''+''' ("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>
(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=
<nowiki/>
|4stat=optional-
| 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
|5=link
|5d=specify <code>link=no</code> to suppress the link  
| 5d-en = specify <code>link=no</code> to suppress the link  
|5stat=optional-
| 5d-td-en = specify “link=no” to suppress the link
| 5av  = no
| 5stat = optional-
| 5type = string


|6={{0}}
|6=<nowiki/>
|6d-td=<nowiki/>
|6d=<br>''more parameters to format the namespace (when "+" or "-" is specified)''
|6d=<br>''more parameters to format the namespace (when "+" or "-" is specified)''
: <small>» not every possible combination of parameter values is useful «</small>
: <small>» not every possible combination of parameter values is useful «</small>
|6def={{0}}
<nowiki/>
|6def=<nowiki/>
|6def-td=
|6stat=optional-
|6stat=optional-
|7=case
|7=case
|7d=for formatting of the namespace:
|7d=for formatting of the namespace:
Line 37: Line 80:
* <code>case=i</code> display the national translation, in general a link   
* <code>case=i</code> display the national translation, in general a link   
* <code>case=n</code> display the national translation without linking it
* <code>case=n</code> display the national translation without linking it
|7stat=optional-
<nowiki/>
|8=lang
| 7sv  = l/i/n
|8d=an {{W|ISO 630-1|ISO 639}} language code, to follow another translation then yours  
| 7stat = optional-
:when parameter setting is <tt>case=i</tt> or <tt>case=n</tt>
| 7type = string
|8def={{int:lang}}
 
|8stat=optional-
|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


|name={{BASEPAGENAME}}
|9    ={{#ifeq:{{PAGENAME}}|U/main|par1}}
|desc=Link to a user, either internal or interwiki
|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 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 choose the effective {{Tl|Ud}}.}}  
*{{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 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>
|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 to the new user page with the user name.
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.   
*The {{T0|Uc|-}} checks whether the user page exists, and links to it if ''yes''.
* 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 checks whether a user~commonswiki 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.
:::: Otherwise it checks whether a user~commonswiki talk page exists, and links to it if ''yes''..
:<small>Since existence checks are not possible in other Wikipedias, these checks are performed only when ''no language code'' is specified.</small>
::::: Otherwise it links to the special page "user contributions" that lists the editor's contributions on Commons.
<!-- *The {{T0|Uw|-}} links the user page with the suffix ''~commonswiki''. -->
: 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-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>
only in combination with <tt>case=i</tt> or <tt>case=n</tt> the namespace can be translated (according to {{T0|i18n/namespace|<tt>lang</tt>}}).
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}}}}


{{namespace/display|t={{BASEPAGENAME}}|name=username}}
| 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 83: 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.