Template:By/doc: Difference between revisions
More actions
mNo edit summary |
No edit summary |
||
| (7 intermediate revisions by 4 users not shown) | |||
| Line 18: | Line 18: | ||
|i18n-subpage = | |i18n-subpage = | ||
|i18n-mediawiki-msg = | |i18n-mediawiki-msg = | ||
|i18n-method =switch | |i18n-method = switch | ||
|example = | |example = | ||
|print = | |print = | ||
|1 = 1 | |1 = 1 | ||
|1d = <span style="font-size:larger">This '''optional''' parameter can be used to specify a user.</span><br> | |1d = <span style="font-size:larger">This '''optional''' parameter can be used to specify a user.</span><br /> | ||
The value of that parameter is used as an argument for the template {{T0|U}}<br> | The value of that parameter is used as an argument for the template {{T0|U}}<br /> | ||
''except'' when it starts with either "&", "<", "[" or "{" — it will be used as-it-is<br> | ''except'' when it starts with either "&", "<", "[" or "{" — it will be used as-it-is<br /> | ||
e.g. wikilinks; other user name templates like {{t|Ut}}, {{T|Uw}}; or < | e.g. wikilinks; other user name templates like {{t|Ut}}, {{T|Uw}}; or <code>&#8202;</code><br /> | ||
whith {{T0|userlist|'''userlist'''}} the correctly translated conjunction will be displayed. | |||
---- | ---- | ||
This option is useful for other templates displaying ''file names'', e.g. | This option is useful for other templates displaying ''file names'', e.g. | ||
| Line 31: | Line 32: | ||
*{{t2|F}} | *{{t2|F}} | ||
*{{t2|Igen}} | *{{t2|Igen}} | ||
*{{t2|Attrib}} | *{{t2|Attrib}}<!-- | ||
*{{t2|Using}} | |||
*{{t2|Based}} --> | |||
*{{t2|Attribs}} | *{{t2|Attribs}} | ||
*{{t2|Original}} | *{{t2|Original}} | ||
*{{t2|Derivative}} | |||
*{{t2|Own using}} | |||
*{{t2|Own based}} | *{{t2|Own based}} | ||
*{{t2|Derived from}} | *{{t2|Derived from}} | ||
*{{t2|Extracted from}} | *{{t2|Extracted from}} | ||
| Line 47: | Line 50: | ||
|1stat=optional- | |1stat=optional- | ||
|2 = 2 | |2 = 2 | ||
|2d = <code>nl</code> ''or'' <code>br</code><br>to force a final line feed; otherwise same line continuation ''may'' follow | |2d = <code>nl</code> ''or'' <code>br</code><br />to force a final line feed; otherwise same line continuation ''may'' follow | ||
|2def = nothing | |2def = nothing | ||
|2stat=optional- | |2stat=optional- | ||
|3 = 3 | |3 = 3 | ||
|3d = <code>ns</code>"no space" - suppress leading space<br>may also set as the 2{{exp|nd}} parameter | |3d = <code>ns</code>"no space" - suppress leading space<br />may also set as the 2{{exp|nd}} parameter | ||
|3def = space | |3def = space | ||
|3stat=optional- | |3stat=optional- | ||
|4 = 4 | |4 = 4 | ||
|4d = with <code>+</code> ''or'' <code>-</code> the namespace < | |4d = with <code>+</code> ''or'' <code>-</code> the namespace <code>user:</code> is written<br />may also set as the 2{{exp|nd}} or 3{{exp|rd}} parameter | ||
|4stat=optional- | |4stat=optional- | ||
|5 = mc= | |5 = mc= | ||
| Line 62: | Line 65: | ||
}} | }} | ||
See also the explanations in the [[Template talk:I18n/by|Comparison table]]. | See also the explanations in the [[Template talk:I18n/by|Comparison table]]. | ||
== Link or textual == | |||
Normally the argument of the {{T0|by}} template is a user name, and a link to the user page occurs using {{T0|U|+}}.<br /> | |||
Sometimes this automatism is not desired; when e.g. no user page exists and the link should be e.g. to the user talk page.<br /> | |||
In such cases the complete link can be coded as the argument, e.g. <nowiki>|by={{U|user}}, |by={{Ut|user}}, |by={{Uw|user}}, |by={{Uwt|user}}</nowiki><!--; <br /> | |||
or the link of the user names are modified, to use e.g. {{T0|Ut}}, {{T0|Uw}}, {{T0|Uwt}} instead of {{T0|U}} -->.<br /> | |||
The first character either "&" (Unicode), "<" (e.g. a table as from {{T|Creator}}), "[" or "{" (a link) will be recognized by the template,<br /> and the parameter is passed without treating it as an argument for the {{T0|U|+}}.<br /> | |||
Instead of a single user id, a {{T0|userlist|userlist}} can specify a number of users; for formatting options, see {{T0|userlist|+}}.<br /> | |||
Another possibility can be that ''flat text'' should be used as the argument. This can be signalled to the template with special prefixes,<br />as either one of | |||
the doubles <code>&&</code>, <code>((</code>, <code>..</code>, <code><<</code> or the pairs <code>()</code>, <code><></code>, <code>[]</code>, <code>{}</code>.<br /> | |||
Such two-character prefixes are removed from the argument before it is passed. | |||
;Nolink examples:: | |||
* <kbd><nowiki>{{By|&&flattext}}</nowiki></kbd> → {{By|&&flattext}} | |||
* <kbd><nowiki>{{By|((flattext}}</nowiki></kbd> → {{By|((flattext}} | |||
* <kbd><nowiki>{{By|..flattext}}</nowiki></kbd> → {{By|..flattext}} {{0}} "<kbd>..</kbd>" is easy to type on most keyboards | |||
* <kbd><nowiki>{{By|<<flattext}}</nowiki></kbd> → {{By|<<flattext}} {{0}} "<kbd><<</kbd>" is easy to type on German-layout keyboards | |||
* <kbd><nowiki>{{By|<>flattext}}</nowiki></kbd> → {{By|<>flattext}} | |||
* <kbd><nowiki>{{By|[]flattext}}</nowiki></kbd> → {{By|[]flattext}} {{0}} "<kbd>[]</kbd>" is easy to type on American-layout keyboards | |||
== Meta categories == | == Meta categories == | ||
Latest revision as of 13:44, 24 October 2025
Returns the word "by" in the language setting of the user's interface.
Usage
{{By}}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | This optional parameter can be used to specify a user. The value of that parameter is used as an argument for the template U This option is useful for other templates displaying file names, e.g.
| empty | optional | |
2 | nl or brto force a final line feed; otherwise same line continuation may follow | nothing | optional | |
3 | ns"no space" - suppress leading spacemay also set as the 2nd parameter | space | optional | |
4 | with + or - the namespace user: is writtenmay also set as the 2nd or 3rd parameter | empty | optional | |
mc= | set to mc=y if used for #Meta categories | 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
See also
Template:{{I18n/by}} and the Comparison table
Localization
To add your language to the list of languages supported by this template, please edit the template and add a row to the "{{LangSwitch|}}" construct. It takes the form "|xx= Your translation " (xx being the code of your language)
See also the explanations in the Comparison table.
Link or textual
Normally the argument of the By template is a user name, and a link to the user page occurs using Template:U.
Sometimes this automatism is not desired; when e.g. no user page exists and the link should be e.g. to the user talk page.
In such cases the complete link can be coded as the argument, e.g. |by={{U|user}}, |by={{Ut|user}}, |by={{Uw|user}}, |by={{Uwt|user}}.
The first character either "&" (Unicode), "<" (e.g. a table as from {{Creator}}), "[" or "{" (a link) will be recognized by the template,
and the parameter is passed without treating it as an argument for the Template:U.
Instead of a single user id, a userlist can specify a number of users; for formatting options, see Template:Userlist.
Another possibility can be that flat text should be used as the argument. This can be signalled to the template with special prefixes,
as either one of
the doubles &&, ((, .., << or the pairs (), <>, [], {}.
Such two-character prefixes are removed from the argument before it is passed.
- Nolink examples:
- {{By|&&flattext}} → by flattext
- {{By|((flattext}} → by flattext
- {{By|..flattext}} → by flattext ".." is easy to type on most keyboards
- {{By|<<flattext}} → by flattext "<<" is easy to type on German-layout keyboards
- {{By|<>flattext}} → by flattext
- {{By|[]flattext}} → by flattext "[]" is easy to type on American-layout keyboards
Meta categories
It's a problem that the English "by" has different translation depending on the semantics.
Die Vorlage differenziert in
- "durch" (Standard)
- "von" (wenn ein Benutzername folgt)
- "nach" (wenn der Parameter
mc=[für "Metakategorie"] gesetzt ist)