Template:Tl/doc
From NevaCal
|
|
This is a documentation subpage for Template:Tl (see that page for the template itself). It contains usage information, categories and other content that is not part of the original template page. |
This template simplifies documenting and demonstrating templates by making is very easy to display links to templates. Additionally, some of the Tl-family of templates demonstrate up to ten parameters, and some provide other useful links (such as to talk pages, change history, etc.).
Contents |
Related templates
- Tl family
- {{Tl}} — A link to a template, no parameters, standard font
- {{Tl2}} — A link to a template, no parameters, monospace font
- {{Tlp}} — A link to a template in the Template namespace, up to 10 parameters, standard font
- {{Tlx}} — A link to a template in the Template namespace, up to 10 parameters, monospace font
- {{Tlu}} — A link to a template outside of the Template namespace, up to 10 parameters, monospace font
- {{Tlf}} — Displays the template name and up to 10 parameters, "nowrap" formatted, standard font
- {{Tld}} — Displays the template name and up to 10 parameters, "nowrap" formatted, monospace font
- {{Tlc}} — Displays the template name and up to 10 parameters, "nowrap" formatted, HTML "
<code>" style
- Lt family
- {{Lt}} — A link to a template and several related links, no parameters, standard font
- {{Lts}} — A link to a template and a few related links, no parameters, standard font
- {{Lthl}} — A link to a template and several related links, no parameters, monospace font, highlighted formatting
- {{Ltpch}} — A link to a template and several related links, up to 10 parameters, monospace font, HTML "
<code>" style, highlighted formatting
Usage
Tl: Template link (standard font)
{{Tl}}
{{Tl}} displays in regular text the template name only. The template may be located in any namespace, but if it is located in any namespace other than "Template:", the full page name, including the namespace, must be given.
The version of {{Tl}} here is a highly customizable meta template. You can create the same output of all of the following templates using special attributes. To activate a feature, set the attribute (true or y are strongly recommended to help make things more clear to other editors).
- NOWRAP=true — displays the text without linebreaks (using
<span style="white-space:nowrap;">) - TT=true — displays the text in a monospace font (the text will look like this)
- CODE=true — wraps the text inside a pair of "<code>" HTML tags (
the text will look like this) - SUBST=true — prepends "subst:" to the template, indicating that the template should be substituted at the time the page is saved
- For backward compatibility, subst= can be used instead of SUBST=
- NOLINK=true — disables the automatic linking of the template name to the template's page
- BOLD=true — makes the template name bolder (the text will look like this)
- LANG=code: — use with any standard language code (en, de, es, fr…) to specify a particular language version of the target wiki (e.g., "es" would specify the Spanish language site)
- IW=code: — use with any standard interwiki code to specify a target wiki other than this site; this can be combined with LANG
- |LANG=en:|IW=w: — the English (en:) Wikipedia (w:)
- |LANG=de:|IW=w: — the German (de:) Wikipedia (w:)
- |IW=m: — the Meta Wikipedia (m:)
- |IW=commons: — Wikimedia Commons (commons:)
- For backward compatibility, SISTER= can be used instead of IW=
- PARAMS=true — indicates that one to ten parameters are included in the example and should be displayed
- EDIT=true — adds a link to edit the template
- TALK=true — adds a link to the template's talk page
- LINKS=true — adds a link to a list of pages that link to or transclude the template
- HISTORY=true — adds a link to the edit history of the template
- WATCH=true — adds a link to add the template to your watch list
- LOGS=true — adds a link to view the logs for the template
Tl2: Template link (monospace font)
{{Tl2}}
{{Tl2}} works identically to {{Tl}}, but with a monospace font instead.
Tlp: Template link with parameters (standard font)
{{Tlp}}
{{Tlp}} displays in standard text the template name and optionally up to ten parameters.
- Example
- {{Tlp|Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}} →
- {{Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}}
Tlx: Template link expanded (monospace font)
{{Tlx}}
{{Tlx}} is idential to {{Tlp}} except displayed in a monospace font.
- Example
- {{Tlx|Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}} →
- {{Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}}
Tlu: Template link expanded (unrestricted)
{{Tlu}}
{{Tlu}} works identically to {{Tlx}} on this wiki. On other wikis that do not use a meta version of {{Tl}}, the {{Tlx}} template only works with templates located in the Template namespace. The {{Tlu}} template works only with template not located there.
For maximum cross-wiki compatibility, it is highly recommended that editors continue to link to templates in the Template namespace using {{Tlx}}, and everywhere else, use the {{Tlu}} template instead.
Tlf: Template name expanded (standard font)
{{Tlf}}
{{Tlf}} displays the template name in the standard font without a link and optionally up to ten parameters without breaking into multiple lines.
- Example
- {{Tlf|Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}} →
{{Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}}
- Which is equivalent to
- {{Tl|NOWRAP=true|NOLINK=true|PARAMS=true|Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}} →
- {{Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}}
Tld: Template name expanded (monospace font)
{{Tld}}
{{Tld}} is identical to {{Tlf}}, except that a monospace font is used.
- Example
- {{Tld|Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}} →
{{Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}}
- Which is equivalent to
- {{Tl|NOWRAP=true|TT=true|NOLINK=true|PARAMS=true|Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}} →
- {{Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}}
Tlc: Template link expanded (code formatted)
{{Tlc}}
{{Tlc}} identical to {{Tlc}}, except wrapped in HTML "<code>" tags.
- Example
- {{Tlc|Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}} →
{{Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}}
- Which is equivalent to
- {{Tl|NOWRAP=true|CODE=true|NOLINK=true|PARAMS=true|Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}} →
{{Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}}
Lt: Links to template (standard font)
{{Lt}}
{{Lt}} creates a link to a template and additional links to edit the template or add it to your watch list, links to its talk and history pages, link to a list of pages that link to or transclude the template, and to the template's logs.
Lts: Links to template, simpler (standard font)
{{Lts}}
{{Lts}} works identically to {{Lt}}, except it omits the link add it to your watch list and to the template's logs.
Lthl: Links to template, highlighted (monospace font)
{{Lthl}}
{{Lthl}} works identically to {{Lt}}, except in a monospace font with a light yellow background color and border.
Ltpch: Links to template with paramteters, highlighted (code formatted)
{{Ltpch}}
{{Ltpch}} works like {{Lthl}} wrapped in HTML "<code>" tags and with support for up to ten parameters.
- Example
- {{Ltpch|Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}} →
{{Template|first parameter|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th}}
Implementation notes and credits
As mentioned above, the versions of these templates used on this site rely upon a special meta version of the {{Tl}} template that was originally created by Willscrlt for the wiki]. All of the related templates above are designed to emulate the functionality of the templates with the same names found on the English Wikipedia at the end of July 2009. As time passes, the functionality, features, and options may diverge. While the code used to create these templates is original, they are obviously based on Wikipedia templates; thanks go out to all the editors who have helped create the reference templates. All these templates, regardless of any copyright notice saying otherwise, are released under the GNU General Public License (GPL) version 3 or later and the Creative Commons Attribution (CC-BY-3.0-US) and Attribution-Share Alike (CC-BY-SA-3.0-US) licenses versions 3.0 or later. This permits you to reuse these templates practically anywhere, as long as you provide attribution to the original author and link to the original source, subject to the terms of your chosen license.
The templates have been tested on and require MediaWiki version 1.15 or later software due to a dependency in determine page names of templates. The templates could be rewritten fairly easily to avoid that dependency, but the results would not be as reliable in all situations. Likewise, {{ActionLink}} is another original template used by these templates; however the {{Tl}} could be rewritten to use the {{Fullurl:}} ParserFunction instead. All the templates rely heavily on several ParserFunctions and other "magic words". The wiki requires that the ParserFunctions extension be installed to work.
While it is possible to emulate all of the various function with just the {{Tl}} meta template (as shown in many examples), it recommended that you use the various appropriate templates instead of the meta template. This will improve portability and allow pages to be shared between wikis more easily. It is easy to create new templates by combining various options together (as has been done with {{Lthl}} and {{Ltpch}}, which are original creations by Willscrlt not found on Wikipedia). It is for that reason that the {{Tl}} equivalents are shown below many of the templates, to help template editors learn how to combine parameters together to create new templates.
