ᨿᩢ᩠ᨦᨷ᩵ᨸᩖᩯ

This template is used to show example template usage without expanding the template itself.

Basic use

edit

(Note: In the following examples, ellipses (groups of three dots) indicate where parameters have been omitted.)

{{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlx|Template|first parameter|second parameter|third|...|tenth}} produces: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|Template|first parameter|second parameter|third|...|tenth}}

Where parameters might contain one or more equals-signs ("="), replace each equals-sign with {{=}}:

{{Wp/nod/tlxTemplate:Wp/nod\sandbox|tlx|Template|first{{=}}something|second|third{{=}}something|...|tenth}} produces: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|Template|first=something|second|third=something|...|tenth}}

For more than ten parameters, possibly also containing equals-signs, use <nowiki>...</nowiki> thus:

{{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlx|Template|<nowiki>''first''|''second''|''third=something''|...|''999th''</nowiki>}} produces: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|Template|first|second|third=something|...|999th}}

Purpose and naming

edit

Mnemonically, "[t]emplate [l]ink e[x]panded" (after {{tl}}, "[t]emplate [l]ink").

This template allows an example of calling a template, accompanied by one or more parameters, to be displayed without also causing the template to be called.

Up to ten of the template's parameters (numbered or nowiki-keywords) may be displayed as placeholders, while more than over 10 parameters can be displayed using a coded vertical-bar (as in "&#124;..."). A keyword parameter can be used with equals code &#61; or {{=}} or in nowiki-text: "<nowiki>size=10</nowiki>" or all parameters as a string in "<nowiki>" tags; see Examples at bottom. For more details, see this talk page.

Exceptions

If the intended template lists numerous parameters, then perhaps this template should really not be used, and just hardcode the usage with <code><nowiki>. For example:

<code><nowiki>{{Anytemplate|arg1=23|size=250px|other parameters...}}</nowiki></code>.

If a vertical display, with parameters on their own lines, is desired, this can also be laid out manually in this manner, or more rapidly done with <pre>...</pre>.

Parameters

edit
{{tl}} will also not take nor display additional parameters.
Named parameters

|subst=

Setting this parameter to any non-blank value will prefix the string subst: linked to Help:Substitution. This is useful to indicate when a template should be substituted. For example, {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlx|Welcome|3=subst=Y}} produces: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|Welcome|subst=Y}}. This is similar to the action of the {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlxs}} template: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlxs|Welcome}} produces: Template:Tlxs.

|SISTER=

For an interwiki link to other sister projects, such as: |SISTER=M: (Meta), |SISTER=Q: (WikiQuote), |SISTER=S: (WikiSource), etc, facilitating interwiki template documentation and/or discussion.

|LANG=

For a link to Wikipedias in other languages, such as: |LANG=de: (German), |LANG=sv: (Swedish), etc, facilitating cross-language template documentation and/or discussion.

Documentation

edit

{{Tlx}} is a generalization of {{tl}}, {{tlp}} etc., with output that is arguably more legible. This depends on the browser, but narrow gaps between characters such as "{", "|", "}" and links can be hard to read when not monospaced (and hard to click on; for uses like {{!}}, see {{tlw}}, which makes the click target bigger).

Usage

edit
{{tlx|Templatename}}
{{tlx|Templatename|param}}
{{tlx|Templatename|1|2|3|4|5|6|7|8|9|10}}
{{tlx|Templatename|1|2|3|4|5|6|7|8|9|10&#124;more}}
{{tlx|Templatename|param&#61;value}}

There are up to 10 placeholders for parameters of the specified template.

Examples

edit
Note
At the en.wikipedia and Meta sites, X0, X1, X2, ... X9 are sandbox templates for experimentation on involved templates that need be in template space. An auto-cleansing software facility exists that might be used to duplicate the facility on other sister projects.
Code Result Remarks
{{tlx|x0}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x0}}  
{{tlx|Abc}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|Abc}}  
{{tlx|ABC}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|ABC}}  
{{tlx|AbC}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|AbC}}  
{{tlx|x1|one}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x1|one}}  
{{tlx|x2|one|two}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2|one|two}}  
{{tlx|x3|1|2|3|4|5|6|7|8|9|10}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x3|1|2|3|4|5|6|7|8|9|10}}  
{{tlx|x4|1|2|3|4|5|6|7|8|9|10|11}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x4|1|2|3|4|5|6|7|8|9|10|11}} up to 10 parameters...
{{tlx|x5|1|2|3|4|5|6|7|8|9|10&#124;11}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x5|1|2|3|4|5|6|7|8|9|10|11}} Template:Align
{{tlx|x1|x=u}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x1|x=u}} the straightforward equals-sign won't work...
{{tlx|x1|x&#61;u}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x1|x=u}} Template:Align
{{tlx|x1|x{{=}}u}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x1|x=u}} Template:Align
{{tlx|x1|<nowiki>x=u</nowiki>}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x1|x=u}} Template:Align
{{tlx|x2| |two}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2| |two}} empty won't work...
{{tlx|x2|&#32;|two}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2| |two}} Template:Align
{{tlx|x2|&nbsp;|two}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2| |two}} Template:Align
{{tlx|x2|<nowiki />|two}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2||two}} Template:Align
{{tlx|x2| &#124; two}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2| | two}} Template:Align
{{tlx|x2| {{!}} two}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2 | | two}} Template:Align
{{tlx|x2|2=|3=two}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2|2=|3=two}} empty really doesn't work
{{tlx|x2|2=one|two}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2|two}} "two" overrides "2=one"
{{tlx|x2|3=two|2=one}} {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2|3=two|2=one}} Template:Align
Unlimited parameters as one <nowiki>...</nowiki> string
{{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlx|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}}

See also

edit
  • {{tlxb}}, a version of {{tlx}} where the template name is shown in bold.
    {{tlb}}, a version of {{tl}} where the template name is shown in bold.
  • {{temt}}, a version of {{tlx}} that handles templates whose names include "Template:" and pages outside the Template: namespace that are treated as templates.
  • {{para}}, for the presentation of template parameters and values (e.g. |paraname=val, |another=).

Template-linking templates

edit

Template:Wp/nod/navbar

General-purpose formatting

edit
Comparison of template-linking templates according to the styles of generated text and link produced
Text style ↓ Template:Wp/nod/Template link expanded options[note 1]
to achieve text style
Link style
Linked Unlinked Linked with subst Unlinked with subst Linked including braces Linked with alternative text
Template:Wp/nod/Template link expanded options[note 1]
to achieve link style
Template:Wp/nod/n/a Template:Wp/nod/n/a nolink=yes subst=yes nolink=yes|subst=yes braceinside=yes alttext=Foo
2=Foo
normal Template:Wp/nod/n/a

{{tlg}}[note 1]
{{tl}}
{{tlp|1|2|...}}[note 2]
Template:Wp/nod/tlu[note 3]

{{tlf}}[note 2]
<template link>
Template:Wp/nod/tls
Template:Wp/nod/tlsu[note 3]
{{tlsf}}[note 2]
<template link>
Template:Tn {{tla}}
code code=yes {{tl2}}
Template:Wp/nod/Template link expanded
Template:Wp/nod/tlxu[note 3]
Template:Wp/nod/tlc[note 2]
<template link>
{{tnull}}<template link>
Template:Wp/nod/tlxs Template:Wp/nod/tlsc[note 2]
<template link>
colspan="2" rowspan="3" Template:Wp/nod/n/a
monospace plaincode=yes[note 4] colspan="2" rowspan="2" Template:Wp/nod/n/a Template:Wp/nod/tltss[note 5] rowspan="2" Template:Wp/nod/n/a
kbd kbd=yes[note 5]
bold bold=yes Template:Wp/nod/tlb colspan="5" rowspan="3" Template:Wp/nod/n/a
bold+code bold=yes|code=yes Template:Wp/nod/tlxb
italic+code italic=yes|code=yes Template:Wp/nod/tlxi

Template:Wp/nod/NoteFoot

Other formatting templates

edit
Templates producing specialised formatting effects for given templates, modules or parameters
Code example Effect Notes
{{tl2|Hatnote|lang=fr}} {{hatnote}} Supports linking to sister projects (e.g., fr:Hatnote)
{{demo|<nowiki>{{Hatnote|lang=fr|Some text}}</nowiki>}} Template:Wp/nod/demo Shows code and example
{{tln|Hatnote}} Template:Wp/nod/tln Produces a normal link to the template
{{elc|Template:Hatnote}}
{{elc|Template:Hatnote|Hatnote}}
Template:Wp/nod/elc
Template:Elc
Formats wikilink, with optional piped link text and blended suffix
{{ml|Example|hello}} Template:Wp/nod/ml Counterpart to {{tl}} for linking to Lua modules
{{mlx|Example|hello}} Template:Wp/nod/mlx Counterpart to {{tlx}} for linking to Lua modules
{{ml-lua|Module:Example|hello}} Template:Wp/nod/ml-lua Link to Lua modules and built-in libraries, showing Lua code.
{{para|title|<var>book title</var>}} |title=book title Formats template parameters for display, with or without values
{{sclx|LASTING}} Template:Sclx Takes a shortcut suffix in project namespace and displays it with brackets and the WP: alias in a <code>...</code> tag.
{{tag|ref}}
{{xtag|templatedata}}
<ref>...</ref>
Template:Xtag
Formats [X]HTML tags; can add content, choose opening, closing, or self-closing
{{dtl|Ping project}} Template:Wp/nod/dtl Wikidata counterpart to {{tl}}
{{pf|if}}
{{pf|if|{{{1}}}|true|false}}
Template:Wp/nod/pf
Template:Wp/nod/pf
Parser function equivalent to {{tl}}
{{magic word|uc:}} Template:Wp/nod/magic word Magic word links
edit
Templates producing utility links for a given template (Hatnote used here as example)
Code example Effect
{{lt|Hatnote}} Template:Wp/nod/lt
{{lts|Hatnote}} Template:Wp/nod/lts
{{t links|Hatnote}} Template:Wp/nod/t links
{{tfd links|Hatnote}} Template:Wp/nod/tfd links
{{tetl|Hatnote}} Template:Wp/nod/tetl
{{tsetl|Hatnote}} Template:Wp/nod/tsetl
{{ti|Hatnote}} Template:Wp/nod/ti
{{tic|Hatnote}} Template:Wp/nod/tic
{{tim|Hatnote}} Template:Wp/nod/tim
{{tiw|Hatnote}} Template:Hatnote Template:Wp/nod/smaller
{{tlt|Hatnote}} Template:Wp/nod/tlt
{{ttl|Hatnote}} Template:Wp/nod/ttl
{{twlh|Hatnote}} Template:Wp/nod/twlh


Template data

Show example template usage without expanding the template itself.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Template name1

Name of the template to link

Example
Tlx
Templaterequired
1st parameter2

no description

Stringoptional
2nd parameter3

no description

Stringoptional
3rd parameter4

no description

Stringoptional
4th parameter5

no description

Stringoptional
5th parameter6

no description

Stringoptional
6th parameter7

no description

Stringoptional
7th parameter8

no description

Stringoptional
8th parameter9

no description

Stringoptional
9th parameter10

no description

Stringoptional
10th parameter11

no description

Stringoptional
1212

no description

Unknownoptional
substsubst

Set to any value to show "subst:" before the template name

Example
true
Booleanoptional
LanguageLANG

For a link to Wikipedias in other languages

Example
de:
Stringoptional
SISTERSISTER

For an interwiki link to other sister projects

Example
M:
Stringoptional


Cite error: <ref> tags exist for a group named "note", but no corresponding <references group="note"/> tag was found