Help:Parameter default: Difference between revisions

Content deleted Content added
Mostly formatting
m top: semantic tags
Line 3:
'''Note:''' Information on this page relates to MediaWiki versions 1.6 and later.
 
Notation: on this page the wikitext <code>{{{A}}}</code> is written as {{mono|[{{var|a}}]}}.
 
In a [[help:template|template]], <code>[{{var|a}}|{{var|b}}]</code> is equal to {{mono|[{{var|a}}]}} if that is defined, and else equal to {{mono|{{var|b}}}}.
 
These results {{mono|[{{var|a}}]}} and {{mono|{{var|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 {{Timc|x0}} can be called as <nowiki>{{tlx|x0|[a]}}</nowiki> even if {{mono|[{{var|a}}]}} is undefined, see e.g. {{Tim|foreach/pass1}}.
 
==Limitation==