Template:Tl2

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

{{[[Template:{{{1}}}|{{{1}}}]]}}

Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Tl2/doc.

This is the {{tl2}} template.


Same as {{Tl}} except adds <code class="nowrap">...</code> around it and allows for one or two parameters.

Usage

{{tl2 |1= |2= |3= }}

Template parameters

<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

Template link with parameters and interwiki

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Template1

Linked template name

Templaterequired
Parameter 12

First parameter value

Stringoptional
Parameter 23

Second parameter value

Stringoptional
Interlanguage Prefixlang LANG

The interwiki language prefix (see: “Special:Interwiki” for a list of valid prefixes)

Stringoptional
Nowrap?nowrap

Whether to add “<span style="white-space: nowrap">”

Default
1
Auto value
0
Booleanoptional
Interwiki Prefixsister SISTER

The interwiki prefix (see: “Special:Interwiki” for a list of valid prefixes)

Stringoptional

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

Comparison:

Comparison 2:

[edit subpage]

Template links

List of templates using {{T/main}}
Code Result Notes lock

{{T|example}}

{{Example}} makes brackets part of the link; see docu Lock-r.svg

{{T0|example}}

Example just link, without the brackets; see docu Lock-g.svg

{{T1|example}}

{{Example}} inner brackets are part of the link; see docu Lock-g.svg

{{T2|example}}

{{Example}} brackets are not a part of the link; see docu Lock-g.svg

{{Tl|example}}

{{Example}} makes brackets around the link; see docu Lock-r.svg

{{Tls|example}}

{{subst:example}} no parameters, adds "subst:" Lock-r.svg
Templates showing parameters 0 Meta template {{Tle}} is easiest to parametrize.

{{Tle|T=F|p1=1|v1|p2=2|v2|p3=3|v3}}

{{ F | 1 = v1 | 2 = v2 | 3 = v3 }} decribes template parameters by names and values Lock-g.svg

{{Tlx|example|1|2|3|4|5||7|8|9}}

{{example|1|2|3|4|5|7|8|...}} up to 8 parameters Lock-r.svg

{{Tlf|example|1|2|3|...up to 8}}

{{example|1|2|3|...up to 8}} up to 8 parameters, no link; see docu Lock-r.svg

{{Tlc|example|1|2|3|4|||7|up to 8|9}}

{{example|1|2|3|4|||7|up to 8}} up to 8 parameters, no link, <code> style Lock-g.svg

{{Tld|example|1|2||3||}}

{{example|1||2|3||}} up to 8 parameters, <code> style; see docu Lock-g.svg

{{Tlr|User:Example}}

{{User:Example}} like {{tl}} but for any namespace Lock-g.svg

{{Tlsu|User:Example}}

{{subst:User:Example}} like {{tlr}}, but also adds "subst:" Lock-g.svg
Alternative forms 0 These ignore empty parameters.

{{Tlp|example|1|2|3|4|5||7|8|9}}

{{example|1|2|3|4|5|7|8}} up to 8 parameters; ignores empty parms Lock-r.svg

{{Tl2|example|p1|p2}}

{{example|p1|p2}} up to 2 parameters, <code> style; see docu Lock-g.svg

{{Tlsp|example|1|2|3|4|5|6|7|8|9}}

{{subst:example|1|2|3|4|5|6|7|8|...}} up to 8 parameters, adds linked "subst:"; see doc Lock-g.svg

{{Tlsx|example|1|2|3|4|5|6|7|8|9}}

{{subst:example|1|2|3|4|5|...}} up to 5 parameters, adds linked "subst:", <code> style Lock-g.svg

General-purpose formatting

Comparison of template-linking templates according to the styles of generated text and link produced
Text style ↓ {{tlg}} options[note 1]
to achieve text style
Link style
Linked Unlinked Linked with subst Unlinked with subst Linked including braces
{{tlg}} options[note 1]
to achieve link style
N/A DEFAULT nolink=yes subst=yes nolink=yes|subst=yes braceinside=yes
normal DEFAULT N/A
code code=yes
N/A
monospace plaincode=yes[note 4] N/A
N/A
kbd kbd=yes[note 5]
  1. a b c {{tlg}} is the most general template, allowing any combination of text style and/or link style options.
  2. a b c d e Prevents wrapping of text by placing it inside <span class="nowrap">...</span> tags.
  3. a b c Allows links to templates in any namespace.
  4. {{tlg|plaincode=yes}} uses <code style="border: none; background-color: transparent;">...</code>.
  5. a b c d Displays monospaced font using <span style="font-family: monospace;">...</span>.

Localization

This template is not intended to be localized.