Template:Tl2/doc

From Linux Web Expert

Usage

This is the {{tl2}} template.

{{tl2}} is similar to {{tl}}. Tl stands for Template link. {{tl2}} is a macro template used to display a template name as a link surrounded by braces, thus showing how the template name would be used in code. Its primary use is in instruction and documentation.

{{tl2}} differs from {{tl}} in that it displays with a wider, monospaced text style (like {{tlx}}) and also takes the named parameters |sister= and |lang= so that it may also be used to list and link templates on other English and non-English-language sister projects.

Related template

{{tlx}} displays with the same enhanced presentation and can also expand several placeholder parameters to generate a sample template call.

Usage

{{tl2|template_name}}
equivalent to {{tl|template_name}}
{{tl2 |sister=sister_id |template_name}}
to display a template from a sister project (e.g. {{tl2 |sister=V |template_name}} for Wikiversity)
{{tl2 |lang=lang_id |sister=sister_id |template_name}}
to display a template from a sister project in another language (e.g. {{tl2 |lang=fr |sister=V |template_name}} for a template from the French Wikisource project)

Examples

Code Result
{{tl|x0}} {{X0 }}
{{tl2|x1}} {{x1}}
{{tl2|sister=M|3x}} {{3x}}
{{tl2|sister=wikibooks|lang=de|WP}} {{WP}}

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools.

Tl2/doc

<templatedata> { "description": "Template link with 2 parameters", "format": "inline", "params": { "1": { "label": "Template", "description": "Linked template name", "required": true, "type": "wiki-template-name" }, "2": { "label": "Parameter 1", "description": "First parameter value", "type": "string" }, "3": { "label": "Parameter 2", "description": "Second parameter value", "type": "string" }, "4": { "label": "Parameter 3", "description": "Third parameter value", "type": "string", "autovalue": "" }, "5": { "label": "Parameter 4", "description": "Fourth parameter value", "type": "string" }, "nowrap": { "label": "Nowrap?", "description": "Whether to add “”", "type": "boolean", "default": "0", "autovalue": "1" }, "sister": { "label": "Interwiki Prefix", "description": "The interwiki prefix (see: “Special:Interwiki” for a list of valid prefixes)", "type": "string" }, "lang": { "label": "Interlanguage Prefix", "description": "The interwiki language prefix (see: “Special:Interwiki” for a list of valid prefixes)", "type": "string" } }, "paramOrder": [ "1", "2", "3", "4", "5", "nowrap", "sister", "lang" ] } </templatedata>

See also

These tables: <span style="" title="<translate nowrap> View this template</translate>"><translate> view</translate> · <span style="" title="<translate nowrap> Discuss this template</translate>"><translate> talk</translate> · <span style="" title="<translate nowrap> Edit this template</translate>"><translate> edit</translate>

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
{{tlg}} options[note 1]
to achieve link style
N/A DEFAULT nolink=1 subst=1
normal DEFAULT
code code=1
monospace mono=1[note 4] N/A
plaincode plaincode=1[note 5]
kbd kbd=1[note 6]
  1. Jump up to: 1.0 1.1 1.2 {{tlg}} is the most general template, allowing any combination of text style and/or link style options.
  2. Jump up to: 2.0 2.1 2.2 Prevents wrapping of text by placing it inside <span style="white-space:nowrap">...</span> tags.
  3. Allows links to templates in any namespace.
  4. Jump up to: 4.0 4.1 4.2 Displays monospaced font using <span style="font-family:monospace">...</span>.
  5. {{Template:Tl2/doc}} uses <code style="background:transparent;border:none">...</code> .
  6. {{Template:Tl2/doc}} uses ‎<kbd> tags.