Template:Tlg/doc

From Encyc

This template, often abbreviated as {{tlg}}, is used to provide stylized formatting to template displays without actually using the template itself. The code generated will be displayed inline. For a multi-line output, see {{tj}}.

Parameters[edit]

With the exception of Template:Mono, the named parameters are toggles that are either omitted (default in most cases) or activated (by being assigned a value such as "on", "yes", "true", "include", etc.). They may be included in any order (see Examples below). Certain templates have the parameter "on" by default; see the main table for all alternate options. If a row renders identically to a previous row, it means the current template does not support that option and {{tlg}} needs to be used instead.

Parameter Action Use with
{{example}}
Default active
Default (without accessory parameters) {{Template:!((:Template:Example|exampleTemplate:))!}}
brace Include braces as part of the template link Template:!((:Template:Example|{{example}}Template:))! {{tlw}}/{{tn}}
braceinside Include innermost braces as part of the template link {Template:!((:Template:Example|{example}Template:))!}
bold Renders the template link/name in bold {{Template:!((:Template:Example|exampleTemplate:))!}} {{tlb}}, {{tlxb}}
code Display output using HTML <code>...</code> tags (monospaced font) {{Template:!((:Template:Example|exampleTemplate:))!}} {{tlc}}, {{Template link expanded}}, etc.
italic Display any parameters accompanying the template link/name in italics {{Template:!((:Template:Example|exampleTemplate:))!|param}} {{tlxi}}
kbd Display output using HTML <kbd>...</kbd> tags (monospaced font) {{Template:!((:Template:Example|exampleTemplate:))!}}
nolink Don't render the template name as a link {{example}} {{tlf}}, {{tnull}}
nowrap Prevent the insertion of line breaks (word wrap) in the output {{Template:!((:Template:Example|exampleTemplate:))!}} {{tlp}}
nowrapname Prevent word wrapping in the output of template name/link (parameters will wrap if needed) {{Template:!((:Template:Example|exampleTemplate:))!}}
plaincode Uses <code style="border:none; background:transparent;">...</code> {{Template:!((:Template:Example|exampleTemplate:))!}} {{tltss}}
subst Include a subst: prefix before the template link/name {{subst:Template:!((:Template:Example|exampleTemplate:))!}} {{tls}}, {{tlxs}}, etc
alttext=[text] Replace [text] with the actual label to be displayed for the template link {{Template:!((:Template:Example|OtherTemplate:))!}} {{tla}}
_show_result Will also display the result of the template {{Template:!((:Template:Min|MinTemplate:))!|7|-5}}
_expand Will add a link to the expanded template page {{Template:!((:Template:Min|MinTemplate:))!|7|-5}}
a will add an asterisk before the template code {{Template:!((:Template:Min|MinTemplate:))!|7|-5}}

Unnamed (Positional)[edit]

This template can take any number of unnamed parameters as parameters accompanying the template link (or name); see Examples below.

Examples[edit]

Use the displayed value in the code column, not the underlying source code.

Note
On the source sister projects, en.wikipedia and Meta, 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 Output Remarks
Template:Tji {{Template:!((:Template:Banner|BannerTemplate:))!}} Template:Banner does not exist. (Non-existent template is redlinked.)
Template:Tji {{Template:!((:Template:Abc|AbcTemplate:))!}} Template:Abc exists.
Template:Tji {{Template:!((:Template:AbC|abCTemplate:))!}} Template names are case-sensitive
Template:Tji {{Template:!((:Template:Abc|abcTemplate:))!}} (but the first letter is case-insensitive).
Template:Tji {{Template:!((:Template:X0|x0Template:))!}} no parameters
Template:Tji {{Template:!((:Template:X1|x1Template:))!|one}} one parameter
Template:Tji {{Template:!((:Template:X2|x2Template:))!|one|two}} two parameters
Template:Tji {{Template:!((:Template:X2|x2Template:))!|one=1|two=2}} two parameters, assigned values
Template:Tji {{Template:!((:Template:X3|x3Template:))!|1|2|3|4|5|6|7|8|9|10}} ten parameters
Template:Tji {{Template:!((:Template:Convert|convertTemplate:))!|14|m|ftin|abbr=out|sp=us}} Unlimited parameters, as one <nowiki>...</nowiki> string.
Template:Tji {{Template:!((:Template:X2|x2Template:))!||two||}} Empty parameters are discarded.
Template:Tji {{Template:!((:Template:X0|x0Template:))!}} <code> style
Template:Tji {{Template:!((:Template:X0|x0Template:))!}} plaincode style
Template:Tji {{Template:!((:Template:X0|x0Template:))!}} <kbd> style
Template:Tji {{Template:!((:Template:X0|x0Template:))!}} bold link/name
Template:Tji {{Template:!((:Template:X1|x1Template:))!|one}} parameter(s) in italics
Template:Tji {{x0}}
Template:Tji {{subst:Template:!((:Template:X0|x0Template:))!}}
Template:Tji Template:!((:Template:X0|{{x0}}Template:))! all braces in link
Template:Tji {Template:!((:Template:X0|{x0}Template:))!} inside braces in link
Template:Tji {{Template:!((:Template:X0|x0 linkTemplate:))!}}
Template:Tji Template:!((:Template:X0|{{x0}}Template:))! Combine multiple parameter settings.
Template:Tji {{Template:!((:Template:Abc|abcTemplate:))!|<span class="nowrap"> </span>one<span class="nowrap"> </span>}} Using {{spaces}} before and after a parameter.
Template:Tji {{Template:!((:Template:X2|x2Template:))!|one|two}} Can combine named and anonymous parameters ...
Template:Tji {{Template:!((:Template:X2|x2Template:))!|one|two}} ... in any order ...
Template:Tji {{Template:!((:Template:X2|x2Template:))!|one|two|three}} ... even intermixed ...
Template:Tji {{Template:!((:Template:X2|x2Template:))!|one|two|three}} ... with many configurations.
Template:Tji {{Template:!((:Template:X1|x1Template:))!}} = won't work
Template:Tji {{Template:!((:Template:X1|x1Template:))!|x=u}} &#61; is okay
Template:Tji {{Template:!((:Template:X1|x1Template:))!|x=u}} {{=}} is okay (see Template:=)
Template:Tji {{Template:!((:Template:X1|x1Template:))!|x=u}} Sticky nowiki is okay.
Template:Tji {{Template:!((:Template:X2|x2Template:))!|one|two}} Template:Align
Template:Tji tlg With no arguments, it emits the current page name without braces.
Template:Tji {{Template:!((:Template:X2|x2Template:))!|one|two}} Null parameter stops parsing.
Wrapping of long names (default)
Code Output
Template:Tji {{Template:!((:Template:Long template name that would wrap to new line|long template name that would wrap to new lineTemplate:))!|this is a long value for the 1st parameter that would wrap}}
Wrapping of long names (nowrap=on)
Code Output
Template:Tji {{Template:!((:Template:Long template name that would wrap to new line|long template name that would wrap to new lineTemplate:))!|long value for the 1st parameter that would wrap}}
Wrapping of long names (nowrapname=on)
Code Output
Template:Tji {{Template:!((:Template:Long template name that would wrap to new line|long template name that would wrap to new lineTemplate:))!|long value for the 1st parameter that would wrap}}

See also[edit]

Template:Template-linking templates Template:Semantic markup templates