Difference between revisions of "Template:Template-linking templates"

From MINR.ORG WIKI
m (162 revisions imported: Import Template Tlx and subtemplates)
 
(29 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{Navbar-header|{{lower|0.5em|{{resize|120%|'''Template-linking templates'''}}}}|Tl-nav|plain=1}}
+
{{navbar|Template-linking templates|plain=1}}<!--
<noinclude>{{float|{{template shortcut|Tl-nav|Tl templates}}}}</noinclude>
+
--><noinclude>{{float|{{template shortcut|tl-nav|tl templates}}}}</noinclude><!--
 
+
-->
==Template linking, overview==
+
===General-purpose formatting===
''This overview may be incomplete and miss certain features. See the documentation of individual templates.''
+
{| class="wikitable navbox collapsible" style="width:auto;font-size:90%;margin:1.0em auto 1.0em auto;vertical-align:top;text-align:center;"
{| class="wikitable sortable" style="vertical-align:top;"
+
|+ Comparison of template-linking templates according to their style
! code example !! effect !! essence !! supports<br>params? !! note !! transc's<!--April 2014-->
 
 
|-
 
|-
| {{tlx|tl|Hatnote}}
+
! style=*" |
| {{tlx|hatnote}}
+
! style="background:#fcc;" | Link style →
| base
+
! style="background:#fee;" | Linked
| no
+
! style="background:#fee;" | Unlinked
|  
+
! style="background:#fee;" | Linked with subst
| 2.5M
+
! style="background:#fee;" | Linked including braces
 +
! style="background:#fee;" | Linked with alternative&nbsp;text
 
|-
 
|-
| {{tlx|lts|Hatnote}}
+
! style="background:#ccf;" | Text style ↓
| {{lts|hatnote}}
+
| '''↓ {{tlx|tlg}} options<sup>1</sup> →'''
| base
+
| {{n/a}}
| ?
+
| {{code|nolink{{=}}yes}}
|
+
| {{code|subst{{=}}yes}}
| 14k
+
| {{code|braceinside{{=}}yes}}
 +
| {{code|alttext{{=}}Foo}}<br />{{code|2{{=}}Foo}}
 
|-
 
|-
| {{tlx|t links|Hatnote}}
+
| style="background:#eef;" | normal
| {{t links|hatnote}}
+
| {{n/a|DEFAULT}}
| base
+
| {{nowrap|{{tlx|tlg}}<sup>1</sup>}}<br />{{tlx|tl}}<br />{{tlx|tlp}}<sup>2</sup><br />{{tlx|tlu}}<sup>3</sup>
| no
+
| {{tlx|tlf}}<sup>2</sup>
| For intensive template editing
+
| {{tlx|tls}}<br />{{tlx|tlsp}}
|
+
| {{tlx|tn}}
 +
| {{tlx|tla}}
 
|-
 
|-
| {{tlx|tfd links|Hatnote}}
+
| style="background:#eef;" | <code>code</code>
| {{tfd links|hatnote}}
+
| {{code|code{{=}}yes}}<br />{{code|plaincode{{=}}yes}}<sup>4</sup>
| base
+
| {{tlx|tl2}}<br />{{tlx|tlx}}
| ?
+
| {{tlx|tlc}}<sup>2</sup><br />{{tlx|tld}}<sup>2</sup><br />{{tlx|tnull}}
| Used in heading of a [[WP:TfD]]
+
| {{tlx|tlxs}}
|
+
| colspan="2" {{n/a}}
 
|-
 
|-
| {{tlx|tiw|Hatnote}}
+
| style="background:#eef;" | <kbd>kbd</kbd><br /><span style="font-family:monospace; font-size:larger;">monospace</span>
| {{tiw|hatnote}}
+
| {{code|kbd{{=}}yes}}
| unk
+
| {{tlx|tltt}}<sup>5</sup><br />{{tlx|tltt2}}<sup>5</sup>
| ?
+
| {{n/a}}
|
+
| {{tlx|tltts}}<sup>5</sup><br />{{tlx|tltts3}}<sup>5</sup><br />{{tlx|tltss}}<sup>6</sup>
| 300
+
| colspan="2" {{n/a}}
 
|-
 
|-
| {{tlx|tla|Hatnote|some&nbsp;label}}
+
| style="background:#eef;" | '''bold'''
| {{tla|hatnote|2=some label}}
+
| {{code|bold{{=}}yes}}
| fmt
+
| {{tlx|tlb}}
| ?
+
| rowspan="3" colspan="4" {{n/a}}
| To add a wikilabel
 
| 1000
 
 
|-
 
|-
| {{tlx|tlb|Hatnote}}
+
| style="background:#eef;" | '''<code>bold+code</code>'''
| {{tlb|hatnote}}
+
| {{code|bold{{=}}yes{{!}}code{{=}}yes}}
| fmt
+
| {{tlx|tlxb}}
| ?
 
| [[Wikipedia:Templates_for_discussion#Template:Tlb|TfD]]
 
| 82
 
 
|-
 
|-
| {{tlx|tlc|Hatnote}}
+
| style="background:#eef;" | ''<code>italic+code</code>''
| {{tlc|hatnote}}
+
| {{code|italic{{=}}yes{{!}}code{{=}}yes}}
| unk
+
| {{tlx|tlxi}}
| ?
+
|}
|
+
{{clear}}
| 200k
+
{{plainlist |style=font-size:90% |
 +
* <sup>1</sup> {{tlx|tlg}} is the most general, allowing any combination of text style and/or link style options.
 +
* <sup>2</sup> Prevents wrapping of text by placing it inside {{tag|span|params=class="nowrap"}} tags.
 +
* <sup>3</sup> Allows links to templates in any namespace.
 +
* <sup>4</sup> {{tld|tlg|plaincode{{=}}yes}} uses [[HTML element#code|{{tag|code|params=style="border:none; background:transparent;"}}]].
 +
* <sup>5</sup> Displays [[monospaced font]] using [[HTML element#kbd|{{tag|kbd}}]] tags (changed from [[HTML element#tt|{{tag|tt}}]] for [[HTML5]] compliance).
 +
* <sup>6</sup> Displays monospaced font using {{tag|span|params=style="font-family:monospace;"}}.
 +
}}
 +
 
 +
===Other formatting templates===
 +
{| class="wikitable sortable" style="vertical-align:top;"
 +
! Code example !! Effect !! Notes
 
|-
 
|-
| {{tlx|tld|Hatnote}}
+
| {{tlx|tl2|<nowiki>Hatnote|lang=fr</nowiki>}} || {{tl2|hatnote|lang=fr}} || Supports linking to sister projects (e.g., fr:Hatnote)
| {{tld|hatnote}}
 
| unk
 
| ?
 
|
 
| 14k
 
 
|-
 
|-
| {{tlx|tlf|Hatnote}}
+
| {{tlx|tlu|User:Ahunt/SSHFS}} || {{tlu|User:Ahunt/SSHFS}} || Supports linking to any namespace
| {{tlf|hatnote}}
 
| unk
 
| ?
 
|
 
| 8000
 
 
|-
 
|-
| {{tlx|tlg|Hatnote}}
+
| {{tlx|demo|<nowiki><nowiki>{{Hatnote|lang=fr|Some text}}</nowiki></nowiki>}} || {{demo|<nowiki>{{hatnote|lang=fr|Some text}}</nowiki>}} || Shows code and example
| {{tlg|hatnote}}
 
| unk
 
| ?
 
|
 
| 14k
 
 
|-
 
|-
| {{tlx|tlp|Hatnote}}
+
| {{tlx|xpd|<nowiki>Hatnote|Some hatnote text</nowiki>}} || {{xpd|hatnote|Some hatnote text}} || Shows code, example and a link to expand the template code
| {{tlp|hatnote}}
 
| unk
 
| ?
 
|
 
| 194k
 
 
|-
 
|-
| {{tlx|tlx|Hatnote}}
+
<!-- Yes, I know these two aren't actually template-linking templates, but they're a heck of a lot easier to find if listed in the docs for e.g. {{tl}} -->
| {{tlx|hatnote}}
+
| {{tlx|para|<nowiki>title|<var>book title</var></nowiki>}} || {{para|title|<var>book title</var>}} || Formats template parameters for display, with or without values
| fmt
 
| ?
 
|
 
| 850k
 
 
|-
 
|-
| {{tlx|tlxb|Hatnote}}
+
| {{tlx|elc|Template:Hatnote}}<br/>{{tlx|elc|<nowiki>Template:Hatnote|Hatnote</nowiki>}} || {{elc|Template:Hatnote}}<br/>{{elc|<nowiki>Template:Hatnote|Hatnote</nowiki>}} || Formats wikilink, with optional piped link text and blended suffix
| {{tlxb|hatnote}}
+
|}
| fmt
+
 
| ?
+
===With utility links===
| [[Wikipedia:Templates_for_discussion/Log/2014_April_20#Template:Tlxb|TfD]]
+
{| class="wikitable sortable" style="vertical-align:top;"
| 22
+
! Code example !! Effect
|-
 
| {{tlx|tlxi|Hatnote}}
 
| {{tlxi|hatnote}}
 
| fmt
 
| ?
 
| Italicises params. [[Wikipedia:Templates_for_discussion/Log/2014_April_20#Template:Tlxi|TfD]]
 
| 8
 
|-
 
| {{tlx|tn|Hatnote}}
 
| {{tn|hatnote}}
 
| fmt
 
| ?
 
| [[Wikipedia:Templates_for_discussion/Log/2014_April_20#Template:Tn|TfD]]
 
| 12k
 
 
|-
 
|-
| {{tlx|tnull|Hatnote}}
+
| {{tlx|lts|Hatnote}} || {{lts|hatnote}}
| {{tnull|hatnote}}
 
| unk
 
| ?
 
|
 
| 4000
 
 
|-
 
|-
| {{tlx|xpd|<nowiki>Hatnote|Some hatnote text</nowiki>}}
+
| {{tlx|t links|Hatnote}} || {{t links|hatnote}}
| {{xpd|hatnote|Some hatnote text}}
 
| unk
 
| ?
 
| Show expanded text
 
| 64
 
 
|-
 
|-
| {{tlx|tls|Hatnote}}
+
| {{tlx|tfd links|Hatnote}} || {{tfd links|hatnote}}
| {{tls|hatnote}}
 
| subst
 
| ?
 
|
 
| 21k
 
 
|-
 
|-
| {{tlx|tlsp|<nowiki>Hatnote|Some text</nowiki>}}
+
| {{tlx|tiw|Hatnote}} || {{tiw|hatnote}}
| {{tlsp|Hatnote|2=Some text}}
 
| subst
 
| ?
 
|
 
| 4500
 
 
|-
 
|-
| {{tlx|tlxs|Hatnote}}
+
| {{tlx|tltt|Hatnote}} || {{tltt|Hatnote}}
| {{tlxs|hatnote}}
 
| subst, fmt
 
| ?
 
|
 
|
 
 
|-
 
|-
| {{tlx|tlu|User:Ahunt/SSHFS}}
+
| {{tlx|tetl|Hatnote}} || {{tetl|Hatnote}}
| {{tlu|User:Ahunt/SSHFS}}
 
| ns
 
| ?
 
| Any namespace
 
| 4600
 
 
|-
 
|-
| {{tlx|tl2|<nowiki>Hatnote|lang=fr</nowiki>}}
+
| {{tlx|tsetl|Hatnote}} || {{tsetl|Hatnote}}
| {{tl2|hatnote|lang=fr}}
 
| iw
 
| ?
 
| Sister and other language wikis (e.g., fr:Hatnote)
 
| 2600
 
 
|-
 
|-
|style="background:#eef;" | tetl
+
| {{tlx|ti|Hatnote}} || {{ti|Hatnote}}
| 2
 
| unk
 
| ?
 
| 5
 
|  
 
 
|-
 
|-
|style="background:#eef;" | ti
+
| {{tlx|tic|Hatnote}} || {{tic|Hatnote}}
| 2
 
| unk
 
| ?
 
| 5
 
|  
 
 
|-
 
|-
|style="background:#eef;" | tic
+
| {{tlx|tiw|Hatnote}} || {{tiw|Hatnote}}
| 2
 
| unk
 
| ?
 
| 5
 
|  
 
 
|-
 
|-
|style="background:#eef;" | tiw
+
| {{tlx|tlt|Hatnote}} || {{tlt|Hatnote}}
| 2
 
| unk
 
| ?
 
| 5
 
|  
 
 
|-
 
|-
|style="background:#eef;" | tlc
+
| {{tlx|ttl|Hatnote}} || {{ttl|Hatnote}}
| 2
 
| unk
 
| ?
 
| 5
 
|  
 
 
|-
 
|-
|style="background:#eef;" | tltlsetlc
+
| {{tlx|twlh|Hatnote}} || {{twlh|Hatnote}}
| 2
 
| unk
 
| ?
 
| 5
 
|
 
|-
 
|style="background:#eef;" | tlt
 
| 2
 
| unk
 
| ?
 
| 5
 
|
 
|-
 
|style="background:#eef;" | ttl
 
| 2
 
| unk
 
| ?
 
| 5
 
|
 
|-
 
|style="background:#eef;" | twln
 
| 2
 
| unk
 
| ?
 
| 5
 
|
 
|style="background:#eef;" | tltt
 
| 2
 
| unk
 
| ?
 
| 5
 
|
 
 
 
|}
 
 
 
===Templates by syntax===
 
{| class="wikitable navbox collapsible" style="width:auto;font-size:90%;margin:1.0em auto 1.0em auto;vertical-align:top;text-align:center;"
 
|+ Comparison of template-linking templates according to their style
 
|-
 
!style=*"|
 
!style="background:#fcc;"| Link style →
 
!style="background:#fee;"| Linked
 
!style="background:#fee;"| Unlinked
 
!style="background:#fee;"| Linked with subst
 
!style="background:#fee;"| Linked including braces
 
!style="background:#fee;"| Linked with alternative&nbsp;text
 
|-
 
!style="background:#ccf;"| Text style ↓
 
|'''↓ {{tlx|tlg}} options<sup>1</sup> →'''
 
|{{N/A}}
 
|{{code|nolink{{=}}yes}}
 
|{{code|subst{{=}}yes}}
 
|{{code|braceinside{{=}}yes}}
 
|{{code|alttext{{=}}Foo}}<br>{{code|2{{=}}Foo}}
 
|-
 
|style="background:#eef;"| Normal
 
| {{N/A}}
 
| {{nowrap|{{tlx|tlg}}<sup>1, 2</sup>}}<br>{{tlx|tl}}<br><code>{{tla|t links|2=t&nbsp;links}}</code><br>{{tlx|tlp}}<sup>2</sup>
 
| {{tlx|tlf}}<sup>2</sup>
 
| {{tlx|tls}}<br>{{tlx|tlsp}}
 
| {{tlx|tn}}
 
| {{tlx|tla}}
 
|-
 
!style="background:#eef;"| <code>Code</code>
 
| {{code|code{{=}}yes}} or<br />{{code|tt{{=}}yes}}
 
| {{tlx|tlx}}
 
| {{tlx|tlc}}<sup>2</sup><br>{{tlx|tld}}<sup>2</sup><br>{{tlx|tnull}}
 
| {{tlx|tlxs}}
 
| colspan="2" {{N/A}}
 
|-
 
|style="background:#eef;"| '''Bold'''
 
| {{code|bold{{=}}yes}}
 
| {{tlx|tlb}}
 
| rowspan="3" colspan="4" {{N/A}}
 
|-
 
|style="background:#eef;"| '''<code>Bold code</code>'''
 
| {{code|bold{{=}}yes{{!}}code{{=}}yes}}
 
| {{tlx|tlxb}}
 
|-
 
|style="background:#eef;" | ''<code>Italic code</code>''
 
| {{code|italic{{=}}yes{{!}}code{{=}}yes}}
 
| {{tlx|tlxi}}
 
 
|}
 
|}
{{clear}}
+
<noinclude>
<div align=left style="font-size:90%; text-align:left;"><sup>1</sup> = {{tlx|tlg}} is the most general, allowing any combination of text style and/or link style options.<br />
+
{{documentation}}
<sup>2</sup> = Prevents wrapping of text by placing it inside {{tag|span|params=class="nowrap"}}  tags.</div>
+
</noinclude>

Latest revision as of 20:26, 11 August 2017

Template:NavbarTemplate:Float

General-purpose formatting[edit]

Other formatting templates[edit]

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>}} Template:Demo Shows code and example
{{xpd|Hatnote|Some hatnote text}} Template:If 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
{{elc|Template:Hatnote}}
{{elc|Template:Hatnote|Hatnote}}
Template:Elc
Template:Elc
Formats wikilink, with optional piped link text and blended suffix

With utility links[edit]

Code example Effect
{{lts|Hatnote}} Template:Lts
{{t links|Hatnote}} Hatnote (edit talk history links # /subpages /doc /doc edit /sbox /sbox diff /test) · Module:hatnote
{{tfd links|Hatnote}} Template:Hatnote (edit · talk · history · links · logs · subpages · delete)
{{tiw|Hatnote}} Template:hatnote (backlinks edit)
{{tltt|Hatnote}} {{Hatnote}}
{{tetl|Hatnote}} {{Hatnote}}
links talk view
{{tsetl|Hatnote}} {{subst:Hatnote}}
 links talk view
{{ti|Hatnote}} Template:Hatnote (talk⧼dot-separator⧽links⧼dot-separator⧽edit)
{{tic|Hatnote}} Template:Hatnote (talk links edit)
{{tiw|Hatnote}} Template:Hatnote (backlinks edit)
{{tlt|Hatnote}} {{Hatnote}} (talk)
{{ttl|Hatnote}} Template:Main other{{Hatnote}} (t/l)
{{twlh|Hatnote}} Template:Hatnote (links, talk)
Template documentation[create]