Template:Template link general
More actions
Script error: No such module "Tlg".
{{Tlg}} (abbreviating "[T]emplate [l]ink (with) [g]eneral (options)") is a generalized version of the {{Tl}} ("Template link") template. It can be used to replace or implement {{Tl}} and related templates such as {{Tlb}}, {{Tlx}}, etc.
Usage
{{Template link general |1= }}
Template parameters
- 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.
Wikipedia's help about TemplateData • Commons-specific information
Template link general
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Link Brackets? | brace | Whether to include both brackets as part of the linked template name.
| Boolean | optional |
| Link Inner Brackets? | braceinside | Whether to include the inner brackets as part of the linked template name.
| Boolean | optional |
| Bold? | bold | Whether to add “<span style="font-weight:bolder">” around the linked template name.
| Boolean | optional |
| Code? | code | Whether to add “<code>”.
| Boolean | optional |
| Italic? | italic | Whether to add “<span style="font-style:italic">” around parameters.
| Boolean | optional |
| Kbd? | kbd | Whether to add “<kbd>”.
| Boolean | optional |
| Mono? | mono | Whether to add “<span style="font-family:monospace">”.
| Boolean | optional |
| No Link? | nolink | Whether to not create a link to the template.
| Boolean | optional |
| No Wrap? | nowrap | Whether to add “<span style="white-space:nowrap">”.
| Boolean | optional |
| No Wrap Name? | nowrapname | Whether to add “<span style="white-space:nowrap">” around the linked template name.
| Boolean | optional |
| Plain Code? | plaincode | Whether to add “<code style="background:transparent;border:none">”.
| Boolean | optional |
| Subst? | subst | Whether to use “subst:”.
| Boolean | optional |
| Link Subst? | link subst | Whether the “subst:” prefix should link to the help page on substitution.
| Boolean | optional |
| Display Text | alttext | Displayed link text.
| Line | optional |
| Template | 1 | Linked template name | Template | required |
| Parameter 1 | 2 | First parameter value | Content | optional |
| Parameter 2 | 3 | Second parameter value | Content | optional |
| Parameter 3 | 4 | Third parameter value | Content | optional |
| Parameter 4 | 5 | Fourth parameter value | Content | optional |
| Parameter 5 | 6 | Fifth parameter value | Content | optional |
| Parameter 6 | 7 | Sixth parameter value | Content | optional |
| Parameter 7 | 8 | Seventh parameter value | Content | optional |
| Parameter 8 | 9 | Eighth parameter value | Content | optional |
| Parameter 9 | 10 | Ninth parameter value | Content | optional |
| Parameter 10 | 11 | Tenth parameter value | Content | 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
Parameters
Named
With the exception of alttext, {{Tlg}}'s named parameters are toggles that are either omitted (default) or activated (by being assigned a value such as "on", "yes", "true", "include", etc.). They may be included in any order (see Examples below):
| Parameter | Action | As in |
|---|---|---|
| brace | Include braces as part of the template link | |
| braceinside | Include innermost braces as part of the template link | {{Tlw}} |
| bold boldlink boldname |
Renders the template link/name in bold | {{Tlb}}, {{Tlx}}, etc. |
| code | Display output using HTML <code>...</code> tags (monospaced font) |
{{Tlc}}, {{Tlx}}, etc. |
| plaincode | Uses <code style="background-color: var(--background-color-base, #f8f9fa); border: none;">...</code> |
|
| kbd | Display output using HTML <kbd>...</kbd> tags (monospaced font) |
{{Tltt}}, {{Tltt2}}, etc. |
| italic italics |
Display any parameters accompanying the template link/name in italic type | {{Tlxi}} |
| nolink | Don't render the template name as a link | {{Tlf}} |
| nowrap | Prevent the insertion of line breaks (word wrap) in the output | {{Tlp}}, {{Tlf}}, etc. |
| nowrapname | Prevent word wrapping in the output of template name/link (parameters will wrap if needed) | |
| subst | Include a subst: prefix before the template link/name | {{Tls}} |
| alttext=text | Use text as the label for the template link | {{Tla}} |
Unnamed (Positional)
{{Tlg}} may take up to ten unnamed parameters as parameters accompanying the template link (or name); see Examples below.
Examples
- 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 |
| {{Tlg|Termometro}} | Script error: No such module "Tlg". | Termometro template does not exist. Be aware with linking to non-existing templates, although desired. |
| {{Tlg|Ok}} | Script error: No such module "Tlg". | Ok template does exist |
| {{Tlg|Convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}} | Script error: No such module "Tlg". | Unlimited parameters as one <nowiki>...</nowiki> string |
| {{Tlg|Abc}} | Script error: No such module "Tlg". | |
| {{Tlg|abC}} | Script error: No such module "Tlg". | Template names are case-sensitive |
| {{Tlg|abc}} | Script error: No such module "Tlg". | The first letter of a template's name is case-insensitive, though |
| {{Tlg|Abc|{{spaces}}{{{1}}}{{spaces}}}} | Script error: No such module "Tlg". | Using {{Spaces}} before and after {{{1}}} parameter. |
| {{Tlg|X0}} | Script error: No such module "Tlg". | |
| {{Tlg|X0|code=on}} | Script error: No such module "Tlg". | <code> style |
| {{Tlg|X0|plaincode=on}} | Script error: No such module "Tlg". | plaincode style |
| {{Tlg|X0|kbd=on}} | Script error: No such module "Tlg". | <kbd> style |
| {{Tlg|X0|bold=on}} | Script error: No such module "Tlg". | bold link/name |
| {{Tlg|X1|one|italic=on}} | Script error: No such module "Tlg". | parameter/s in italics |
| {{Tlg|X0|nolink=on}} | Script error: No such module "Tlg". | |
| {{Tlg|X0|subst=on}} | Script error: No such module "Tlg". | |
| {{Tlg|X0|brace=on}} | Script error: No such module "Tlg". | all braces in link |
| {{Tlg|X0|braceinside=on}} | Script error: No such module "Tlg". | inside braces in link |
| {{Tlg|X0|alttext=x0 link}} | Script error: No such module "Tlg". | |
| {{Tlg|X0|bold=on|code=on|brace=on}} | Script error: No such module "Tlg". | No reason you can't combine multiple parameter settings |
| {{Tlg|X1|one}} | Script error: No such module "Tlg". | |
| {{Tlg|X2|one|two}} | Script error: No such module "Tlg". | |
| {{Tlg|X2|bold=on|code=on|one|two}} | Script error: No such module "Tlg". | Can combine named and anonymous parameters … |
| {{Tlg|X2|one|two|bold=on|code=on}} | Script error: No such module "Tlg". | … in any order … |
| {{Tlg|X2|one|code=on|two|bold=on|three}} | Script error: No such module "Tlg". | … even intermixed … |
| {{Tlg|X2|one|code=on|two|bold=on|three|italic=on}} | Script error: No such module "Tlg". | … with many different configurations. |
| {{Tlg|X3|1|2|3|4|5|6|7|...}} | Script error: No such module "Tlg". | |
| {{Tlg|X4|1|2|3|4|5|6|7|...}} | Script error: No such module "Tlg". | up to 10 parameters, then … |
| {{Tlg|X5|1|2|3|4|5|6|7|...}} | Script error: No such module "Tlg". | | for more |
| {{Tlg}} | Script error: No such module "Tlg". | with no arguments, the current page name is substituted |
| {{Tlg|X1|x=u}} | Script error: No such module "Tlg". | = won't work |
| {{Tlg|X1|x=u}} | Script error: No such module "Tlg". | = is okay |
| {{Tlg|X1|x{{=}}u}} | Script error: No such module "Tlg". | {{=}} is okay (see equality symbol template) |
| {{Tlg|X1|x<nowiki>=</nowiki>u}} | Script error: No such module "Tlg". | sticky nowiki is okay |
| {{Tlg|X2||two||}} | Script error: No such module "Tlg". | empty parameters work too, even at the end |
| {{Tlg|X2|3=two|2=one}} | Script error: No such module "Tlg". | right to left okay |
| Code | Output |
|---|---|
| {{Tlg|Long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} | Script error: No such module "Tlg". |
| Code | Output |
|---|---|
| {{Tlg|nowrap=on|Long template name that would wrap to new line|long value for the 1st parameter that would wrap}} | Script error: No such module "Tlg". |
| Code | Output |
|---|---|
| {{Tlg|nowrapname=on|Long template name that would wrap to new line|long value for the 1st parameter that would wrap}} | Script error: No such module "Tlg". |