Help:Parameter default: Difference between revisions

Content deleted Content added
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 61:
For comparison using a="if" and c=d="", and also the shorter class name "if" instead of "HiddenStructure", the two lines are:
 
<syntaxhighlight lang="wikitext">
<nowiki><span class=" if{{{b|}}} "> ... </span></nowiki>
<nowiki>{{{ span class=" if{{{b|}}} | "> ... }}}</nowikispan>
{{{ if{{{b|}}} | ... }}}
 
</syntaxhighlight>
In the second method the wikitext in the template is 15 characters shorter for each optional item, but each call is 4 characters ("if=|") longer.
 
Line 115 ⟶ 116:
<syntaxhighlight lang="wikitext">{{{else{{{test|}}}|{{{test{{{test|}}}|{{{then|}}}}}}}}}</syntaxhighlight>
----
 
 
or in short form:
 
<syntaxhighlight lang="wikitexttext">[ else[test|] | [ test[test|] | [then|] ] ]</syntaxhighlight>
 
If [<code>{{bracket|test]}}</code> is defined this reduces to
 
<syntaxhighlight lang="wikitexttext">[ else[test] | [ test[test] | [then|] ] ]</syntaxhighlight>
 
For test equal to null this reduces to [else<code>{{bracket|]else{{!}}}}</code>; otherwise, if no parameter name starting with "test" or "else" applies except these themselves, then this reduces to [then<code>{{bracket|]then{{!}}}}</code>.
 
If [<code>{{bracket|test]}}</code> is undefined we get
 
<syntaxhighlight lang="wikitexttext">[ else | [then|] ]</syntaxhighlight>
 
==Last-but technique==