This page is currently inactive and is retained for historical reference. Although some of it may still be relevant, this page describes techniques made obsolete by ParserFunctions and Lua. |
Note: Information on this page relates to MediaWiki versions 1.6 and later.
Notation: on this page the wikitext {{{A}}}
is written as [a].
In a template, [a|b]
is equal to [a] if that is defined, and else equal to b.
These results [a] and b can be end results, but they can also be parameter names, parameter values, template names, parts thereof, etc.
If the results are template names as part of template calls involving a parameter of the outer template which may be undefined, one can arrange that an inner template is called with a parameter depending on an undefined outer parameter only if the parameter concerned is not actually used in the inner template, e.g. dummy template Template:x0 containing "<noinclude>{{documentation}}</noinclude>
" can be called as {{x0|[a]}}
even if [a] is undefined, see e.g. m:Template:foreach/pass1 (backlinks edit).