Jump to content

Template:Tlg/doc

Ginen Wikipedia
This is a documentation subpage for Template:Tlg (see that page for the template itself).
It contains usage information, categories and other content that is not part of the original template page.

{{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 source]
Template:Big

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
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 the (monospaced) HTML <code> formatting {{tlc}} {{tlx}} 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 {{tln}}
nowrap Prevent the insertion of line breaks (word wrap) in the output
subst Include a subst: prefix before the template link/name {{tls}}
|alttext=[text] Use [text] as the label for the template link {{tla}}
Template:Big

{{tlg}} may take up to ten unnamed parameters as parameters accompanying the template link (or name); see Examples below.

Examples

[edit source]
Code Output Remarks
{{tlg|Abc}} {{[[:Template:Abc|AbcTemplate:!))}}
{{tlg|abC}} {{[[:Template:AbC|abCTemplate:!))}} template names are case-sensitive
{{tlg|abc}} {{[[:Template:Abc|abcTemplate:!))}} first letter is case-insensitive though
{{tlg|x0}} {{[[:Template:X0|x0Template:!))}}
{{tlg|x0|code=on}} {{[[:Template:X0|x0Template:!))}} <code> style
{{tlg|x0|plaincode=on}} {{[[:Template:X0|x0Template:!))}} plaincode style
{{tlg|x0|bold=on}} {{[[:Template:X0|x0Template:!))}} bold link/name
{{tlg|x1|one|italic=on}} {{[[:Template:X1|x1Template:!))|one}} parameter/s in italics
{{tlg|x0|nolink=on}} {{x0}}
{{tlg|x0|subst=on}} {{subst:[[:Template:X0|x0Template:!))}}
{{tlg|x0|braceinside=on}} {[[:Template:X0|{x0}Template:!))}
{{tlg|x0|alttext=x0 link}} {{[[:Template:X0|x0 linkTemplate:!))}}
{{tlg|x0|bold=on|code=on|braceinside=on}} {[[:Template:X0|{x0}Template:!))} No reason you can't combine multiple parameter settings
{{tlg|x1|one}} {{[[:Template:X1|x1Template:!))|one}}
{{tlg|x2|one|two}} {{[[:Template:X2|x2Template:!))|one|two}}
{{tlg|x2|bold=on|code=on|one|two}} {{[[:Template:X2|x2Template:!))|one|two}} Can combine named and anonymous parameters …
{{tlg|x2|one|two|bold=on|code=on}} {{[[:Template:X2|x2Template:!))|one|two}} … in any order …
{{tlg|x2|one|code=on|two|bold=on|three}} {{[[:Template:X2|x2Template:!))|one|two|three}} … even intermixed …
{{tlg|x2|one|code=on|two|bold=on|three|italic=on}} {{[[:Template:X2|x2Template:!))|one|two|three}} … with many different configurations.
{{tlg|x3|1|2|3|4|5|6|7|8|9|10}} {{[[:Template:X3|x3Template:!))|1|2|3|4|5|6|7|8|9|10}}
{{tlg|x4|1|2|3|4|5|6|7|8|9|10|11}} {{[[:Template:X4|x4Template:!))|1|2|3|4|5|6|7|8|9|10|…}} up to 10 parameters, then …
{{tlg|x5|1|2|3|4|5|6|7|8|9|10&#124;11}} {{[[:Template:X5|x5Template:!))|1|2|3|4|5|6|7|8|9|10|11}} Template:Align
{{tlg}} {{[[:Template:Tlg/doc|Tlg/docTemplate:!))}} with no arguments, the current page name is substituted
{{tlg|x1|x=u}} {{[[:Template:X1|x1Template:!))|x=u}} = won't work
{{tlg|x1|x&#61;u}} {{[[:Template:X1|x1Template:!))|x=u}} Template:Align
{{tlg|x1|x{{=}}u}} {{[[:Template:X1|x1Template:!))|x=u}} Template:Align
{{tlg|x1|x<nowiki>=</nowiki>u}} {{[[:Template:X1|x1Template:!))|x=u}} Template:Align
{{tlg|x2||two||}} {{[[:Template:X2|x2Template:!))||two||}} empty parameters work too, even at the end
{{tlg|x2|2=one|two}} {{[[:Template:X2|x2Template:!))|2=one|two}} two clobbers 2=one
{{tlg|x2|3=two|2=one}} {{[[:Template:X2|x2Template:!))|3=two|2=one}} Template:Align
Unlimited parameters as one nowiki string

{{tlg|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}}

See also

[edit source]

General-purpose formatting

[edit source]

Template:Plainlist

Other formatting templates

[edit source]
Code example Effect Notes
{{tl2|Hatnote|lang=fr}} {{hatnote}} Supports linking to sister projects (e.g., fr:Hatnote)
{{tlu|User:Ahunt/SSHFS}} Template:Tlu Supports linking to any namespace
{{xpd|Hatnote|Some hatnote text}} Template:Xpd1 Shows code, example and a link to expand the template code
{{para|title|<var>book title</var>}} |title=book title Formats template parameters for display, with or without values
[edit source]
Code example Effect
{{lts|Hatnote}} Template:Lts
{{t links|Hatnote}} Template:T links
{{tfd links|Hatnote}} Template:Tfd links
{{tiw|Hatnote}} Template:Tiw
{{tltt|Hatnote}} Template:Tltt
{{tetl|Hatnote}} Template:Tetl
{{tsetl|Hatnote}} Template:Tsetl
{{ti|Hatnote}} Template:Ti
{{tic|Hatnote}} Template:Tic
{{tiw|Hatnote}} Template:Tiw
{{tlt|Hatnote}} Template:Tlt
{{ttl|Hatnote}} Template:Ttl
{{twlh|Hatnote}} Template:Twlh