Template:Tlc

From Wikimedia Commons, the free media repository
Jump to: navigation, search

{{tlc|...}}

Documentation icon Documentationviewedithistorypurge

This documentation is transcluded from Template:Tlc/doc.

This is the {{tlc}} template.

This page is also the documentation for {{tld}} and {{tlf}} that work almost exactly the same.

When showing a template name with brackets in documentation you have to escape the brackets in some way so it doesn't become a call to the template. Instead of using <nowiki></nowiki> tags you can write it simpler and shorter by using these templates.

Here is how these templates look. Code to the left and actual rendering to the right:

{{tlc|name|parameters}} = {{name|parameters}}
{{tld|name|parameters}} = {{name|parameters}}
{{tlf|name|parameters}} = {{name|parameters}}

These templates work similarly to {{tl}} and {{tlx}}, but they don't make the template name into a link. When writing documentation you might want to avoid a lot of unnecessary links, since it decreases readability. So on the first occurrence of a template name use {{tl}} or {{tlx}}, and then use {{tlc}}, {{tld}} or {{tlf}}.

Features of {{tlc}}, {{tld}} and {{tlf}}:

  • They show a template name and up to eight parameters.
  • They also show empty parameters. (See examples below.)
  • They prevent line wraps in their output.

Examples[edit]

Wikitables make the <code></code> tags transparent, that's why the "code colouring" is missing in these examples.

Code Result Comment
{{tlc}} {{tlc|...}} Shows its own syntax.
{{tlc|name}} {{name}}
{{tlc|name|one}} {{name|one}}
{{tlc|name|one|two}} {{name|one|two}}
{{tlc|name|a|b|c|d|e|f|g|h|i|j}} {{name|a|b|c|d|e|f|g|h}} Shows up to eight parameters. The rest are dropped.
{{tlc|name|||three|four}} {{name|||three|four}} Also shows empty parameters.
{{tlc|name|||three||}} {{name|||three||}} Even shows empty parameters that come in the end.
{{tlc|name|one=a|two=b}} {{name}} Equal signs is a problem, but there is a fix.
{{tlc|name|2=one=a|3=two=b}} {{name|one=a|two=b}} Use numbered parameters to fix it. Remember to start from 2, since the "name" is number 1.

If you have equal signs in your template parameters, you should replace then with {{=}}, but it probably is simpler and clearer to code it using <nowiki> tags etc. Here are the codes to emulate {{tlf}}, {{tld}} and {{tlc}} respectively. Code to the left and actual rendering to the right:

<nowiki>{{name|one=a|two=b}}</nowiki> = {{name|one=a|two=b}}
<tt><nowiki>{{name|one=a|two=b}}</nowiki></tt> = {{name|one=a|two=b}}
<code><nowiki>{{name|one=a|two=b}}</nowiki></code> = {{name|one=a|two=b}}

Template links[edit]

Code Result Notes lock

{{t|example}}

{{Example}} makes brackets part of the link; see docu Lock-r.svg

{{t0|example}}

Example just link, without the brackets; see docu Lock-g.svg

{{t1|example}}

{{Example}} inner brackets are part of the link; see docu Lock-g.svg

{{t2|example}}

{{Example}} brackets are not a part of the link; see docu Lock-g.svg
{{tl|example}} {{example}} makes brackets around the link; see docu Lock-r.svg

{{tls|example}}

{{subst:example}} no parameters, adds "subst:" Lock-r.svg

{{tlx|example|1|2|3|4|5||7|8|9}}

{{example|1|2|3|4|5|7|8|...}} up to 8 parameters Lock-r.svg

{{tlxs|example|1|2|3|4|5||7|8|9}}

{{subst:example|1|2|3|4|5||7|8|...}} up to 8 parameters, adds "subst:"; see docu Lock-g.svg

{{tlf|example|1|2|3|...up to 8}}

{{example|1|2|3|...up to 8}} up to 8 parameters, no link; see docu Lock-r.svg

{{tlc|example|1|2|3|4|||7|up to 8|9}}

{{example|1|2|3|4|||7|up to 8}} up to 8 parameters, no link, <code> style Lock-g.svg

{{tld|example|1|2||3||}}

{{example|1||2|3||}} up to 8 parameters, <code> style; see docu Lock-g.svg

{{tlr|User:Example}}

{{User:Example}} like {{tl}} but for any namespace Lock-g.svg

{{tle|p1=1|v1|p2=2|v2|p3=3|v3}}

{{ Tle1 = v12 = v23 = v3 }} decribes parameters and their values Lock-g.svg

Alternative forms[edit]

Note: These ignore empty parameters.
Code Result Notes lock

{{tlp|example|1|2|3|4|5||7|8|9}}

{{example|1|2|3|4|5|7|8}} up to 8 parameters; ignores empty parms Lock-r.svg

{{tl2|example|p1|p2}}

{{example|p1|p2}} up to 2 parameters, <code> style; see docu Lock-g.svg

{{tlsp|example|1|2|3|4|5}}

{{subst:example|1|2|3|etc.}} up to 3 parameters, adds linked "subst:" Lock-g.svg

{{tlsx|example||2|3||6|7|8}}

{{subst:example|2|3|6|...}} up to 5 parameters, adds linked "subst:", teletype style Lock-g.svg
https://commons.wikimedia.org/wiki/Template:Tlc
commons.wikimedia.org
crawl=CC-MAIN-2018-17
65463
application/http; msgtype=response
sha1:U4H7RZQYMUMWVDQM3HAWO335MKU3B64V
<urn:uuid:8859c2a6-8a40-4c75-8025-a257ce634ad4>
2018-04-24T02:59:36Z
208.80.154.224
text/html
sha1:THFTAVH3CTWHVOVFZFRSOOQF2HV3SUGL
<urn:uuid:571d27fb-8cfd-4f8d-8762-95603f1af267>
https://commons.wikimedia.org/wiki/Template:Tlc
length
response
<urn:uuid:48da8146-899b-4d52-87db-afd24ec769a8>
robots: classic
hostname: ip-10-158-89-8.ec2.internal
software: Nutch 1.6 (CC)
isPartOf: CC-MAIN-2018-17
operator: Common Crawl Admin
description: Wide crawl of the web for April 2018
publisher: Common Crawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf