{{Teamplaid:Tlg}}

Template documentation[view] [edit] [history] [purge]

{{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.


Paramadairean - Parameters

deasaich

Ainmichte - Named

deasaich

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 [text] as the label for the template link {{Tla}}

Neo-ainmichte (Suidhichte) - Unnamed (Positional)

deasaich

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

Eisimpleirean - Examples

deasaich
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|Abc}} {{Abc}}
{{Tlg|abC}} {{abC}} template names are case-sensitive
{{Tlg|abc}} {{abc}} first letter is case-insensitive though
{{Tlg|x0}} {{x0}}
{{Tlg|x0|code=on}} {{x0}} <code> style
{{Tlg|x0|plaincode=on}} {{x0}} plaincode style
{{Tlg|x0|Kbd=on}} {{x0}} <Kbd> style
{{Tlg|x0|bold=on}} {{x0}} bold link/name
{{Tlg|x1|one|italic=on}} {{x1|one}} parameter/s in italics
{{Tlg|x0|nolink=on}} {{x0}}
{{Tlg|x0|subst=on}} {{subst:x0}}
{{Tlg|x0|brace=on}} {{x0}} all braces in link
{{Tlg|x0|braceinside=on}} {{x0}} inside braces in link
{{Tlg|x0|alttext=x0 link}} {{x0 link}}
{{Tlg|x0|bold=on|code=on|brace=on}} {{x0}} No reason you can't combine multiple parameter settings
{{Tlg|x1|one}} {{x1|one}}
{{Tlg|x2|one|two}} {{x2|one|two}}
{{Tlg|x2|bold=on|code=on|one|two}} {{x2|one|two}} Can combine named and anonymous parameters …
{{Tlg|x2|one|two|bold=on|code=on}} {{x2|one|two}} … in any order …
{{Tlg|x2|one|code=on|two|bold=on|three}} {{x2|one|two|three}} … even intermixed …
{{Tlg|x2|one|code=on|two|bold=on|three|italic=on}} {{x2|one|two|three}} … with many different configurations.
{{Tlg|x3|1|2|3|4|5|6|7|8|9|10}} {{x3|1|2|3|4|5|6|7|8|9|10}}
{{Tlg|x4|1|2|3|4|5|6|7|8|9|10|11}} {{x4|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}} {{x5|1|2|3|4|5|6|7|8|9|10|11}}
&#124; for more
{{Tlg}} {{Teamplaid:Tlg}} with no arguments, the current page name is substituted
{{Tlg|x1|x=u}} {{x1}} = won't work
{{Tlg|x1|x&#61;u}} {{x1|x=u}}
&#61; is okay
{{Tlg|x1|x{{=}}u}} {{x1|x=u}}
{{=}} is okay
{{Tlg|x1|x<nowiki>=</nowiki>u}} {{x1|x=u}}
sticky nowiki is okay
{{Tlg|x2||two||}} {{x2||two||}} empty parameters work too, even at the end
{{Tlg|x2|3=two|2=one}} {{x2|one|two}}
right to left okay
{{Tlg|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}} {{convert|14|m|ftin|abbr=out|sp=us}} Unlimited parameters as one nowiki string
Wrapping of long names (default)
Code Output
{{Tlg|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} {{long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}}
Wrapping of long names (Nowrap=on)
Code Output
{{Tlg|Nowrap=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} {{long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
Wrapping of long names (nowrapname=on)
Code Output
{{Tlg|nowrapname=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} {{long template name that would wrap to new line|long value for the 1st parameter that would wrap}}

Faic cuideachd - Also see

General-purpose formatting

deasaich
Comparison of template-linking templates according to their style
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=Foo
2=Foo
normal DEFAULT {{Tlg}}1
{{Tl}}
{{Tlp}}2
{{Tlu}}3
{{Tlf}}2 {{Tls}}
{{Tlsp}}
{{Tlsu}}3
{{Tn}} {{Tla}}
code code=yes {{Tl2}}
{{Tlx}}
{{Tlxu}}3
{{Tlc}}2
{{Tld}}2
{{Tnull}}
{{Tlxs}} N/A
monospace
kbd
plaincode=yes4
kbd=yes5
{{Tltt}}5
{{Tltt2}}5
N/A {{Tltss}}6
bold bold=yes {{Tlb}} N/A
bold+code code=yes {{Tlxb}}
italic+code code=yes {{Tlxi}}

Other formatting templates

deasaich
Code example Effect Notes
{{Tl2|Hatnote|lang=fr}} {{Hatnote}} 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>}}
{{Hatnote|lang=fr|Some text}}

Shows code and example
{{Xpd|Hatnote|Some Hatnote text}} "{{Hatnote|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|Example|hello}} {{#invoke:Example|hello}} Counterpart to {{Tl}} for linking to Lua modules
{{Mlx|Example|hello}} {{#invoke:Example|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}} [[w:en: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}}
{{Pf|If}}
{{Pf|If|{{{1}}}|true|false}}
{{#If}}
{{#If:{{{1}}}|true|false}}
Parser function equivalent to {{Tl}}
deasaich
Code example Effect
{{Lt|Hatnote}} Teamplaid:Hatnote (deasaich | deasbaireachd | eachdraidh | ceanglaichean | faire | logaichean)
{{Lts|Hatnote}} Teamplaid:Hatnote(deasaich deasbaireachd ceanglaichean-lìn eachdraidh)
{{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)
{{Tltt|Hatnote}} {{Hatnote}}
{{Tetl|Hatnote}} {{Hatnote}}
links talk view
{{Tsetl|Hatnote}} {{subst:Hatnote}}
 links talk view
{{Ti|Hatnote}} Teamplaid:Hatnote (deasbaireachd⧼dot-separator⧽ceanglaichean-lìn⧼dot-separator⧽deasaich)
{{Tic|Hatnote}} Template:Hatnote (talk links edit)
{{Tim|Hatnote}} m:Template:Hatnote (backlinks edit)
{{Tiw|Hatnote}} Teamplaid:Hatnote (ceanglaichean deasaich) 
{{Tlt|Hatnote}} {{Hatnote}} (talk)
{{Ttl|Hatnote}} {{Hatnote}} (t/l)
{{Twlh|Hatnote}} Template:Hatnote (links, talk)