Template:Tl

From Advocatespedia, ASSN: 10146
Jump to navigation Jump to search

{{[[Template:{{{1}}}|{{{1}}}]]}}

<templatestyles src="Module:Documentation/styles.css"></templatestyles>

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

The template link template is a simple macro template used to display a template name as a link surrounded by braces, thus showing the template name as code rather than actually invoking it. Its primary use is in instruction and documentation where it is used to refer to a template by name without invoking it. Note that this template may be used under the name "tee-el" (tl) as well as "tee-one" (t1)— both function the same way and produce the same results (this is not true for all such visually confusing templates containing a possible 1/l mix-up: {{Tla}} and {{T1a}} are not interchangeable). A short example of its use is:

{{tl|Example}}
which generates
{{Example}}

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Tl

This template displays a template name as a link surrounded by braces, thus showing how the template name would be used in code. Its primary use is in instruction and documentation.

Template parameters

ParameterDescriptionTypeStatus
template name1

the template name without the namespace prefix “Template:”, which is added automatically

Linerequired

More complex variations are described below.

Examples

Code Result Notes
{{tl|Void}} {{Void}} Standard usage
{{tls|Example}} {{subst:Example}} For templates that should be substituted
{{tl2|X1}} {{X1}} This formats the link to show how it would look in code (i.e., monospace font)
{{tl2|sister=M:|3x}} {{3x}} Same as above, for templates on another Wikimedia project (in this example, Meta)
{{tl2|sister=wikibooks|lang=de:|WP}} {{WP}} For templates on another language project
{{tl|1==)}} {{=)}} Use the format {{tl|1=templatename}} if the template contains template coding characters such as {{=)}} or {{!}}

See also

<templatestyles src="Module:Navbar/styles.css"></templatestyles>

General-purpose formatting

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 ↓ Script error: No such module "Template link general". options1 DEFAULT <syntaxhighlight lang="text" class="" id="" style="" inline="1">nolink=yes</syntaxhighlight> <syntaxhighlight lang="text" class="" id="" style="" inline="1">subst=yes</syntaxhighlight> <syntaxhighlight lang="text" class="" id="" style="" inline="1">braceinside=yes</syntaxhighlight> <syntaxhighlight lang="text" class="" id="" style="" inline="1">alttext=Foo</syntaxhighlight>
<syntaxhighlight lang="text" class="" id="" style="" inline="1">2=Foo</syntaxhighlight>
normal DEFAULT Script error: No such module "Template link general".1
Script error: No such module "Template link general".
Script error: No such module "Template link general".2
Script error: No such module "Template link general".3
Script error: No such module "Template link general".2 Script error: No such module "Template link general".
Script error: No such module "Template link general".
Script error: No such module "Template link general".3
Script error: No such module "Template link general". Script error: No such module "Template link general".
code <syntaxhighlight lang="text" class="" id="" style="" inline="1">code=yes</syntaxhighlight> Script error: No such module "Template link general".
Script error: No such module "Template link general".
Script error: No such module "Template link general".3
Script error: No such module "Template link general".2
Script error: No such module "Template link general".2
Script error: No such module "Template link general".
Script error: No such module "Template link general". N/A
monospace
kbd
<syntaxhighlight lang="text" class="" id="" style="" inline="1">plaincode=yes</syntaxhighlight>4
<syntaxhighlight lang="text" class="" id="" style="" inline="1">kbd=yes</syntaxhighlight>5
Script error: No such module "Template link general".5
Script error: No such module "Template link general".5
N/A Script error: No such module "Template link general".5
Script error: No such module "Template link general".5
Script error: No such module "Template link general".6
bold <syntaxhighlight lang="text" class="" id="" style="" inline="1">bold=yes</syntaxhighlight> Script error: No such module "Template link general". N/A
bold+code code=yes</syntaxhighlight> Script error: No such module "Template link general".
italic+code code=yes</syntaxhighlight> Script error: No such module "Template link general".
  • 1  Script error: No such module "Template link general". is the most general, allowing any combination of text style and/or link style options.
  • 2  Prevents wrapping of text by placing it inside <span class="nowrap">...</span> tags.
  • 3  Allows links to templates in any namespace.
  • 4  Script error: No such module "Template link general". uses <code style="border:none; background-color:transparent;">...</code>.
  • 5  Displays monospaced font using <kbd>...</kbd> tags (changed from <tt>...</tt> for HTML 5 compliance).
  • 6  Displays monospaced font using <span style="font-family:monospace;">...</span>.

Other formatting templates

Code example Effect Notes
Script error: No such module "Template link general". {{hatnote}} Supports linking to sister projects (e.g., fr:Hatnote)
Script error: No such module "Template link general". {{User:Ahunt/SSHFS}} Supports linking to any namespace
Script error: No such module "Template link general".
{{hatnote|lang=fr|Some text}}

Shows code and example
Script error: No such module "Template link general". "{{hatnote|Some hatnote text}}" gives "" [1] Shows code, example and a link to expand the template code
Script error: No such module "Template link general". Template:Hatnote Produces a normal link to the template
Script error: No such module "Template link general".
Script error: No such module "Template link general".
[[Template:Hatnote]]
[[Template:Hatnote|Hatnote]]
Formats wikilink, with optional piped link text and blended suffix
Script error: No such module "Template link general". {{#invoke:Bananas|hello}} Counterpart to {{tl}} for linking to Lua modules
Script error: No such module "Template link general". {{#invoke:Bananas|hello}} Counterpart to {{tlx}} for linking to Lua modules
Script error: No such module "Template link general". |title=book title Formats template parameters for display, with or without values
Script error: No such module "Template link general". [[WP:LASTING]] Takes a shortcut suffix in project namespace and displays it with brackets and the WP: alias in a <code>...</code> tag.
Script error: No such module "Template link general".
Script error: No such module "Template link general".
<ref>...</ref>
<templatedata>
Formats [X]HTML tags; can add content, choose opening, closing, or self-closing
Script error: No such module "Template link general". {{d:Ping project}} Wikidata counterpart to {{tl}}

With utility links

Code example Effect
Script error: No such module "Template link general". Template:Hatnote (edit | talk | history | links | watch | logs)
Script error: No such module "Template link general". Template:Hatnote(edit talk links history)
Script error: No such module "Template link general". Hatnote (edit talk history links # /subpages /doc /doc edit /sbox /sbox diff /test)
Script error: No such module "Template link general". Template:Hatnote (edit · talk · history · links · transclusions · logs · subpages · delete)
Script error: No such module "Template link general". Template:hatnote (backlinks edit)
Script error: No such module "Template link general". {{Hatnote}}
Script error: No such module "Template link general". {{Hatnote}}
links talk view
Script error: No such module "Template link general". {{subst:Hatnote}}
 links talk view
Script error: No such module "Template link general". Template:Hatnote (talk⧼dot-separator⧽links⧼dot-separator⧽edit)
Script error: No such module "Template link general". Template:Hatnote (talk links edit)
Script error: No such module "Template link general". Template:Hatnote (backlinks edit)
Script error: No such module "Template link general". {{Hatnote}} (talk)
Script error: No such module "Template link general". Template:Error{{Hatnote}} (t/l)
Script error: No such module "Template link general". Template:Hatnote (links, talk)