Template:Template link general/doc: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content deleted Content added
update /doc to make it more of a centralized container |
|||
Line 3:
{{lua|Module:Tlg}}
This template, often abbreviated as {{tlf|{{#switch:{{lc:{{ROOTPAGENAME}}}}
| tlg | template link general = tlg
| tlb | template link with bold = tlb
| tlc | template link code = tlc}}
}}, is used to provide stylized links to templates without expanding the template itself.
===Parameters===
With the exception of {{mono|alttext}},
▲With the exception of {{mono|alttext}}, {{tlf|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 ([[Template:Tlg#Examples|see Examples below]]):
{| class="wikitable"
! Parameter || Action ||
|-
| brace || Include braces as part of the template link || {{tl|tlw}}/{{tl|tn}}
|-
| braceinside || Include innermost braces as part of the template link ||
|-
| bold
|-
| code || Display output using HTML [[HTML element#code|{{tag|code}}]] tags ([[monospaced font]]) || {{tl|tlc}}, {{tl|tlx}}, etc.
|-
| italic || Display any parameters accompanying the template link/name in ''italics'' || {{tl|tlxi}}
| plaincode || Uses {{tag|code|params=style="border:none; background:transparent;"}} ||▼
|-
| kbd || Display output using HTML [[HTML element#kbd|{{tag|kbd}}]] tags (monospaced font) ||
|-
|
|-
| nowrap || Prevent the insertion of line breaks ([[word wrap]]) in the output ||
|-▼
▲| nowrap || Prevent the insertion of line breaks ([[word wrap]]) in the output || {{tl|tlp}}, {{tl|tlf}}, etc.
|-
| nowrapname || Prevent word wrapping in the output of template name/link (parameters will wrap if needed) ||
|-
▲| plaincode || Uses {{tag|code|params=style="border:none; background:transparent;"}} || {{tl|tltss}}
| subst || Include a [[Help:Substitution|subst:]] prefix before the template link/name || {{tl|tls}}▼
▲|-
▲| subst || Include a [[Help:Substitution|subst:]] prefix before the template link/name || {{tl|tls}}, {{tl|tlxs}}, etc
|-
|
|}
====Unnamed (Positional)====
===Examples===
Line 48 ⟶ 52:
|style=background-color:transparent;<!-- to see background of <code>...</code> -->
| '''Code''' | '''Output''' | '''Remarks'''
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
| {{tlx|
}}
Line 91 ⟶ 95:
! style="width:15em;" | Output
|-
| {{tlx|
| {{
|}
Line 101 ⟶ 105:
! style="width:15em;" | Output
|-
| {{tlx|
| {{
|}
Line 111 ⟶ 115:
! style="width:15em;" | Output
|-
| {{tlx|
| {{
|}
|
Revision as of 17:13, November 20, 2020
This is a documentation subpage for Template:Template link general. It may contain usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
This template, often abbreviated as {{tlg}}, is used to provide stylized links to templates without expanding the template itself.
Parameters
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.
Parameter | Action | Default active |
---|---|---|
brace | Include braces as part of the template link | {{tlw}}/{{tn}} |
braceinside | Include innermost braces as part of the template link | |
bold | Renders the template link/name in bold | {{tlb}}, {{tlxb}} |
code | Display output using HTML <code>...</code> tags (monospaced font) |
{{tlc}}, {{tlx}}, etc. |
italic | Display any parameters accompanying the template link/name in italics | {{tlxi}} |
kbd | Display output using HTML <kbd>...</kbd> tags (monospaced font) |
|
nolink | Don't render the template name as a link | {{tlf}}, {{tlc}}, {{tnull}} |
nowrap | Prevent the insertion of line breaks (word wrap) in the output | |
nowrapname | Prevent word wrapping in the output of template name/link (parameters will wrap if needed) | |
plaincode | Uses <code style="border:none; background:transparent;">...</code> |
{{tltss}} |
subst | Include a subst: prefix before the template link/name | {{tls}}, {{tlxs}}, etc |
|alttext=[text] |
Use [text] as the label for the template link | {{tla}} |
Unnamed (Positional)
This template takes 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.
Script error: No such module "aligned table".
Code | Output |
---|---|
{{Template link general|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}}
|
{{Template:!((:Template:Long template name that would wrap to new line|long template name that would wrap to new line]]|this is a long value for the 1st parameter that would wrap}} |
Code | Output |
---|---|
{{Template link general|nowrap=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
|
{{Template:!((:Template:Long template name that would wrap to new line|long template name that would wrap to new line]]|long value for the 1st parameter that would wrap}} |
Code | Output |
---|---|
{{Template link general|nowrapname=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
|
{{Template:!((:Template:Long template name that would wrap to new line|long template name that would wrap to new line]]|long value for the 1st parameter that would wrap}} |
See also
Template:Template-linking templates