Help:Parameter default: Difference between revisions

Content deleted Content added
m top: semantic tags
m Limitation: syntaxhighlight
Line 16:
The expression for the parameter name can also contain "|", as part of full template or parameter syntax within it.
 
Examples, using <code><nowiki>{{x3}}</nowiki></code> containing <code><nowikisyntaxhighlight lang="moin" inline>{{{1}}}{{{1}}}{{{1}}}</nowiki></codesyntaxhighlight> and <code><nowikisyntaxhighlight lang="moin" inline>{{t2}}</nowiki></codesyntaxhighlight> containing <code><nowikisyntaxhighlight lang="moin" inline>start-{{{1}}}-middle-{{{2}}}-end</nowiki></codesyntaxhighlight>:
*<code><nowikisyntaxhighlight lang="moin" inline>{{{a|b|c|d}}}</nowiki></codesyntaxhighlight> gives <code>{{{A|b|c|d}}}</code>
*<code><nowikisyntaxhighlight lang="text" inline>{{{a|{{x3|b}}}}}</nowiki></codesyntaxhighlight> gives <code>{{{A|bbb}}}</code>
*<code><nowikisyntaxhighlight lang="text" inline>{{{a|{{{b|c}}}}}}</nowiki></codesyntaxhighlight> gives <code>{{{A|{{{b|c}}}}}}</code>
*<code><nowikisyntaxhighlight lang="moin" inline>{{{a|[[b|c]]}}}</nowiki></codesyntaxhighlight> gives <code>{{{A|[[b|c]]}}}</code>
*<code><nowikisyntaxhighlight lang="moin" inline>{{{{{x3|a}}|b}}}</nowiki></codesyntaxhighlight> gives <code>{{{aaa|b}}}</code> - parameter aaa is undefined
*<code><nowikisyntaxhighlight lang="text" inline>{{{{{{a|b}}}|c}}}</nowiki></codesyntaxhighlight> gives <code>{{{{{{A|b}}}|c}}}</code> - parameter b is undefined
 
*<code><nowikisyntaxhighlight lang="moin" inline>{{{a|<nowiki>b|c</nowiki><nowiki><</nowiki>/nowiki>}}}</codesyntaxhighlight> gives <code>{{{A|<nowiki>b|c</nowiki>}}}</code> - works fine for rendering text, but is not suitable for putting parameters b and c in a template call (there is no function for removing nowiki tags):
*:<code><nowikisyntaxhighlight lang="moin" inline>{{t2|{{{a|<nowiki>b|c</nowiki><nowiki><</nowiki>/nowiki>}}}}}</codesyntaxhighlight> gives <code>start-b|c-middle-{{{2}}}-end</code>
 
*<code><nowikisyntaxhighlight lang="moin" inline>{{{a|b{{!}}c}}}</nowiki></codesyntaxhighlight> gives <code>{{{a|b{{!}}c}}}</code>, and the bar will be interpreted by the next layer of templates.
 
==Expressions containing a parameter, with default==