Template:Template link/doc: Difference between revisions

From Vintage Story Wiki
mNo edit summary
Line 1: Line 1:
== Template link ==
{{shortcut|tl|t}}
This template serves as a way to easily link to other templates, as an in-line code block with a link to the respective template.
This template is used to easily link to a template, while displaying the template brackets.


=== Parameters ===
== Usage ==
{| class="wikitable"
{{Tl|tl|template name|subst{{=}}<var>yes/no</var>|code{{=}}<var>yes/no</var>}}
|-
! Parameter !! Description !! Type !! Status
|-
| template ('''1''') || The template to be linked || Template || '''required'''
|}


=== Example ===
''template name'' can be any page, using the same conventions as transclusion. Basically the "Template:" prefix is optional, and a colon is required to link the main space.
<code><nowiki>{{tl|Infobox}}</nowiki></code> produces {{tl|Infobox}}.
 
Parameters can also be added, to a maximum of 8. Note that <code>=</code>'s must be escaped using {{t|1==}}
 
The <code>|subst</code> parameter will determine whether the template link will display as a substed template or not. If the subst parameter is set, it will display the word "subst:" in front of the template link.
 
Set <code>|code</code> to no to disable code formatting.
 
== Examples ==
* {{Tl|tl|Icon link}} → {{tl|Icon link}}
* {{Tl|tl|Template:Infobox|subst{{=}}yes}} → {{tl|Template:Infobox|subst=yes}}
* {{Tl|tl|move|Page to move to|Optional reason}} → {{tl|move|Page to move to|Optional reason}}
* {{Tl|tl|Delete|reason|subst{{=}}1}} → {{tl|Delete|reason|subst{{=}}1}}
 
<includeonly>
<!-- Template categories/interwiki here -->
[[Category:Link templates]]
</includeonly>

Revision as of 18:26, 31 August 2022

Shortcuts

This template is used to easily link to a template, while displaying the template brackets.

Usage

{{tl|template name|subst=yes/no|code=yes/no}}

template name can be any page, using the same conventions as transclusion. Basically the "Template:" prefix is optional, and a colon is required to link the main space.

Parameters can also be added, to a maximum of 8. Note that ='s must be escaped using

Delete.png

This template is a candidate for deletion.
Reason: Template name could be misleading. Not used.
Before deletion, check what links to this page, the page history, and the page log.
Don't forget to delete this template's documentation if it exists.


The |subst parameter will determine whether the template link will display as a substed template or not. If the subst parameter is set, it will display the word "subst:" in front of the template link.

Set |code to no to disable code formatting.

Examples

  • {{tl|Icon link}}{{Icon link}}
  • {{tl|Template:Infobox|subst=yes}}{{subst:Infobox}}
  • {{tl|move|Page to move to|Optional reason}}{{move|Page to move to|Optional reason}}
  • {{tl|Delete|reason|subst=1}}{{Delete|reason|subst=1}}