Help:Template: Difference between revisions

Content deleted Content added
Undid revision 1233258608 by Giraffedata (talk) Positional params don't become named params when you use sequential numbering to specify them. Positional params may be represented positionally, or explicitly via numeric sequence. When used anonymously they must be in order: {{done|a|b}} only; but when used explicitly, {{done|2=b|1=a}} is allowed.
Nesting templates: Correct parameter passing example
Line 284:
A template can even choose which subtemplate parameter to pass conditionally.
;Examples{{colon}}
:Template:A contains <syntaxhighlight lang="wikitext" inline>the quick brown {{B|{{{13}}}=fox}} jumps over...</syntaxhighlight>. Template:B (a subtemplate) contains <syntaxhighlight lang="moin" inline>'''{{{jumper}}}'''</syntaxhighlight>. Page X calls A with <syntaxhighlight lang="wikitext" inline>{{A|apple|pear|jumper}}</syntaxhighlight>. This expands to <syntaxhighlight lang="wikitext" inline>"the quick brown '''fox''' jumps over..."</syntaxhighlight>. The third unnamed parameter passed to Template:A is passed as the name of the parameter passed to subtemplate B with the value "fox".
 
{{shortcut|WP:TEMPLATE LOOP}}