Template:T: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(New unified code)
Tag: Removed redirect
m (Added a third parameter to avoid the template name without a link and templates {{P}} from sticking together)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><onlyinclude><code style="padding:0; white-space:pre-wrap">&#123;&#123;{{#if:{{{1|}}}|[[Template:{{{1|}}}|{{{1|}}}]]}}{{{2|}}}&#125;&#125;</code></onlyinclude></includeonly>
<includeonly><onlyinclude><samp style="white-space:pre-wrap">&#123;&#123;{{#if:{{{1|}}}|[[Template:{{{1|}}}|{{{1|}}}]]}}{{{2|}}}{{{3|}}}&#125;&#125;</samp></onlyinclude></includeonly>
This Template used to display a template name as a link (or plain text) surrounded by braces, thus showing how the template name would be used in code.
{{Doc}}
 
== Examples ==
{{Code|{{T|T}}}} → {{T}}
 
{{Code|{{T|T|{{P|Test}}}}}} → {{T|Test}}
 
{{Code|{{T|T|{{P}}{{P|Test}}}}}} → {{T||Test}}
 
{{Code|{{T|T|{{P|Test}}{{P}}{{T|P|{{P|Some Text}}}}}}}} → {{T|Test|{{P|Some Text}}}}
 
{{Code|{{T|T|{{P}}{{P|Test}}{{T|P|{{P|Some Text}}}}}}}} → {{T||Test{{P|Some Text}}}}
 
{{Code|{{T|T|{{P|Test}}{{P}}{{T|P|{{P|param}}{{P|10}}}}}}}} → {{T|Test|{{P|param|10}}}}
 
{{Code|{{T|T|{{P|&amp;#61;}}}}}} → {{T|&#61;}}
 
{{Code|{{T|T|{{P|!}}}}}} → {{T|!}}
 
== Multiline support ==
{{CodeBlock|<nowiki>{{T|Test|
{{P| Unnamed param}}
{{P| empty |}}
{{P| param | 8}}
}}</nowiki>}}
 
 
{{T|Test|
{{P| Unnamed param}}
{{P| empty |}}
{{P| param | 8}}
}}
 
==== Without link ====
{{CodeBlock|<nowiki>{{T||Test
{{P| Unnamed param}}
{{P| empty |}}
{{P| param | 8}}
}}</nowiki>}}
 
 
{{T||Test
{{P| Unnamed param}}
{{P| empty |}}
{{P| param | 8}}
}}

Latest revision as of 02:58, 1 October 2025

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
Page history

This template is used to display a template name as a link (or plain text) surrounded by braces, thus showing how the template name would be used in code.

Examples

{{T}}{{}}

{{T|Test}}{{Test}}

{{T||Test}}{{Test}}

{{T|Test|{{P|Some Text}}}}{{Test|Some Text}}

{{T||Test|{{P|Some Text}}}}{{Test|Some Text}}

{{T|Test|{{P|param|10}}}}{{Test|param=10}}

Multiline support

{{T|Test| {{P| Unnamed param}} {{P| empty |}} {{P| param | 8}} }}

{{Test | Unnamed param | empty = | param = 8

}}