Templates Wiki
Templates Wiki
(use <var> instead of <span> + italics)
Tag: sourceedit
(I hate this keyboard)
Tag: sourceedit
Line 1: Line 1:
{{ #if: {{{style|}}} | <code> }}<nowiki>{{</nowiki><span style="padding: 0 0.1em;">{{ #if: {{{prefix|}}} | {{{prefix}}}: }}[[{{ #ifeq: {{ #sub: {{{1}}} | 0 | 1 }} | : || {{ #if: {{NAMESPACE:{{{1}}}}} || {{ns:10}} }} }}:{{{1}}}|{{ #ifeq: {{ #sub: {{{1}}} | 0 | 1 }} | : | : }}{{ #ifeq: {{NAMESPACE:{{{1}}}}} | {{ns:10}} | {{PAGENAME:{{{1}}}}} | {{{1}}} }}]]</span>{{ #if: {{{2}}}
+
{{ #if: {{{style|}}} | <code> }}<nowiki>{{</nowiki><span style="padding: 0 0.1em;">{{ #if: {{{prefix|}}} | {{{prefix}}}: }}[[{{ #ifeq: {{ #sub: {{{1}}} | 0 | 1 }} | : || {{ #if: {{NAMESPACE:{{{1}}}}} || {{ns:10}} }} }}:{{{1}}}|{{ #ifeq: {{ #sub: {{{1}}} | 0 | 1 }} | : | : }}{{ #ifeq: {{NAMESPACE:{{{1}}}}} | {{ns:10}} | {{PAGENAME:{{{1}}}}} | {{{1}}} }}]]</span>{{ #if: {{{2|}}}
 
| &#124;<var style="padding: 0 0.2em; color: gray;">{{{2}}}</var> }}{{ #if: {{{3|}}}
 
| &#124;<var style="padding: 0 0.2em; color: gray;">{{{2}}}</var> }}{{ #if: {{{3|}}}
 
| &#124;<var style="padding: 0 0.2em; color: gray;">{{{3}}}</var> }}{{ #if: {{{4|}}}
 
| &#124;<var style="padding: 0 0.2em; color: gray;">{{{3}}}</var> }}{{ #if: {{{4|}}}

Revision as of 16:51, 22 February 2017

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

Export this template, then import, to install it.
Use edit summary: Copied from [[w:c:templates:Template:T]] to properly attribute this template's editors.
This template is probably already on your wiki.
Description
A template link with a variable number of example parameters (0–20), which can be used to show example inputs.
Syntax
{{t|parameter1|parameter2|parameter3|parameter4|...|parameter20|prefix=prefix|style=code|block=block}}
Line breaks (<br/>) can be useful for for adding three dots to seperate content ( ... ). An example is listed below
Sample code
{{t|welcome}} gives...
{{welcome}}
{{t|welcome|Item1|Item2|Item3|Item4|Item5|...}} gives...
{{welcome|Item1|Item2|Item3|Item4|Item5|...}}
{{t|welcome|2=param1=Item1}} gives...
{{welcome|param1=Item1}}
{{t|welcome|prefix=subst}} gives...
{{subst:welcome}}
{{t|welcome|style=code}} gives...
{{welcome}}
{{t|welcome|2=Item1|3=Item2|4=Item3<br/>...|block=true}} gives...
{{welcome|Item1|Item2|Item3
...
}}
Full usage
{{t|welcome|2=param1=Item1|3=param2=Item2|4=param3=Item3<br/>...|5=param10=Item10|block=true|style=code|prefix=subst}} gives...
{{subst:welcome|param1=Item1|param2=Item2|param3=Item3
...
|param10=Item10}}
See also
{{t2}}
{{s}}