Template:Tlg
From Historical Hastings
{{tlg}} (abbreviating "[t]emplate [l]ink (with) [g]eneral (options)") is a generalised version of the {{tl}} ("template link") template. It can be used to replace or implement {{tl}} and related templates such as {{tlb}}, {{tlx}}, etc.
Parameters[edit]
Named[edit]
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="border:none; background:transparent;">...</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/s | {{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 [texHatnoteas the label for the template link | {{tla}} |
Unnamed[edit]
{{tlg}} may take up to ten unnamed parameters as parameters accompanying the template link (or name); see Examples below.
Examples[edit]
- 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.
{{safesubst:#invoke:aligned table|table}}
| Code | Output |
|---|---|
{{tlg|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}}
|
{{
|
| Code | Output |
|---|---|
{{tlg|nowrap=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
|
{{
|
| Code | Output |
|---|---|
{{tlg|nowrapname=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
|
{{
|
See also[edit]
General-purpose formatting[edit]
| Link style → | Linked | Unlinked | Linked with subst | Linked including braces | Linked with alternative text | |
|---|---|---|---|---|---|---|
| Text style ↓ | ↓ {{tlg}} options1 →
|
DEFAULT | nolink=yes
|
subst=yes
|
braceinside=yes
|
alttext=Foo2=Foo
|
| normal | DEFAULT | {{tlg}}1{{tl}}{{tlp}}2{{tlu}}3
|
{{tlf}}2
|
{{tls}}{{tlsp}}{{tlus}}3
|
{{tn}}
|
{{tla}}
|
code
|
code=yes
|
{{tl2}}{{tlx}}{{tlxu}}3
|
{{tlc}}2{{tld}}2{{tnull}}
|
{{tlxs}}
|
N/A | |
| monospace kbd |
plaincode=yes4kbd=yes5
|
{{tltt}}5{{tltt2}}5
|
N/A | {{tltts}}5{{tltts3}}5{{tltss}}6
| ||
| bold | bold=yes
|
{{tlb}}
|
N/A | |||
bold+code
|
bold=yes|code=yes
|
{{tlxb}}
| ||||
italic+code
|
italic=yes|code=yes
|
{{tlxi}}
| ||||
| ||||||
Other formatting templates[edit]
| Code example | Effect | Notes |
|---|---|---|
{{tl2|Hatnote|lang=fr}} |
Template:Tl2 | Supports linking to sister projects (e.g., fr:Hatnote) |
{{tlu|User:Ahunt/SSHFS}} |
{{User:Ahunt/SSHFS}} | Supports linking to any namespace |
{{demo|<nowiki>{{Hatnote|lang=fr|Some text}}</nowiki>}} |
lang=fr|Some text}} |
Shows code and example |
{{xpd|Hatnote|Some hatnote text}} |
Some hatnote text}}" gives "" [1] | Shows code, example and a link to expand the template code |
{{tln|Hatnote}} |
Template:Hatnote | Produces a normal link to the template |
{{elc|Template:Hatnote}}{{elc|Template:Hatnote|Hatnote}} |
[[Template:Hatnote]][[Template:Hatnote|Hatnote]] |
Formats wikilink, with optional piped link text and blended suffix |
{{ml|Bananas|hello}} |
{{#invoke:Bananas|hello}} | Counterpart to {{tl}} for linking to Lua modules |
{{mlx|Bananas|hello}} |
{{#invoke:Bananas|hello}} |
Counterpart to {{tlx}} for linking to Lua modules |
{{para|title|<var>book title</var>}} |
title=book title | Formats template parameters for display, with or without values |
{{sclx|LASTING}} |
[[WP:LASTING]] |
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><templatedata> |
Formats [X]HTML tags; can add content, choose opening, closing, or self-closing |
{{dtl|Ping project}} |
{{d:Ping project}} | Wikidata counterpart to {{tl}} |
With utility links[edit]
| Code example | Effect |
|---|---|
{{lt|Hatnote}} |
Template:Hatnote (ediHatnote| talk | [https://www.historymap.info/index.php?title=Template:Hatnote&action=history history | links | watch | logs) |
{{lts|Hatnote}} |
Template:Hatnote(edit talk links history) |
{{t links|Hatnote}} |
Hatnote (edit talk history links # /subpages /doc /doc edit /sbox /sbox diff /test) |
{{tfd links|Hatnote}} |
Template:Hatnote (edit · talk · history · links · transclusions · logs · subpages · delete) |
{{tiw|Hatnote}} |
Template:Tiw |
{{tltt|Hatnote}} |
{{Hatnote}} |
{{tetl|Hatnote}} |
{{Hatnote}} |
{{tsetl|Hatnote}} |
{{subst:Hatnote}} |
{{ti|Hatnote}} |
Template:Hatnote (talk⧼dot-separator⧽links⧼dot-separator⧽edit) |
{{tic|Hatnote}} |
Template:Hatnote (talk links edit) |
{{tiw|Hatnote}} |
Template:Tiw |
{{tlt|Hatnote}} |
{{Hatnote}} (talk) |
{{ttl|Hatnote}} |
{{Hatnote}} (t/l) |
{{twlh|Hatnote}} |
Template:Hatnote (links, talk) |
| The above documentation is transcluded from Template:Tlg/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |