Difference between revisions of "Template:Template link"

From ComputerCraft Wiki
Jump to: navigation, search
(to make links to templates a little more consistent (as I've see both an unlinked {{delete}} and Template:Delete.) Template from Minecraft Wiki, usable under the license provided there)
 
m
 
Line 1: Line 1:
<includeonly><code>{{[[:{{#if: {{#pos: {{{1}}} | : }} || Template: }}{{{1}}}|{{ #ifeq: {{NAMESPACE:{{{1}}}}} | Template | {{PAGENAME:{{{1}}}}} | {{{1}}} }}]]{{ #if: {{{2|}}} | {{!}}{{{2}}} }}{{ #if: {{{3|}}} | {{!}}{{{3}}} }}{{ #if: {{{4|}}} | {{!}}{{{4}}} }}{{ #if: {{{5|}}} | {{!}}{{{5}}} }}}}</code></includeonly><noinclude>
+
<includeonly><code>{{[[:{{#if: {{#pos: {{{1}}} | : }} || Template: }}{{{1}}}|{{ #ifeq: {{NAMESPACE:{{{1}}}}} | Template | {{PAGENAME:{{{1}}}}} | {{{1}}} }}]]{{ #if: {{{2|}}} | {{!}}{{{2}}} }}{{ #if: {{{3|}}} | {{!}}{{{3}}} }}{{ #if: {{{4|}}} | {{!}}{{{4}}} }}{{ #if: {{{5|}}} | {{!}}{{{5}}} }}}}</code></includeonly><noinclude>{{Documentation}}</noinclude>
{{/doc}}
+
</noinclude>
+

Latest revision as of 10:09, 2 August 2020

[ view | edit | history ] Documentation

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

Usage

{{tl|template name}}

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 4. Note that ='s must be escaped using {{=}}

Examples

{{tl|Example}} gives:
{{Example}}

{{tl|Template:Block}} gives:
{{Block}}

{{tl|:Main Page}} gives:
{{ :Main Page}}

{{tl|fullurl|page|text}} gives:
{{fullurl|page|text}}