Module:Params/doc: Difference between revisions

Content deleted Content added
Line 384:
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|unique_coins|[first coin = value 1]|[second coin = value 2]|[...]|[last coin = value N]}}</syntaxhighlight>
 
This function is used to detect the existence of flag parameters. For this reason, it is almost alwaysoften accompanied by the <code>[[#sequential|sequential]]</code> modifier (or, equivalently, by <code>...&#124;[[#excluding_non-numeric_names|excluding_non-numeric_names]]&#124;[[#clearing|clearing]]&#124;...</code>). For a similar function that allows the repetition of identical flags, see the <code>[[#coins|coins]]</code> function.
 
A typical use case of this function is that of constructing [[URL]]s. For example, the following template named <syntaxhighlight lang="wikitext" inline>{{example template}}</syntaxhighlight> checks for the <code>html</code>, <code>xml</code>, <code>comments</code> and <code>removenowiki</code> flags in order to append respectively the following strings to the final URL: <code>&amp;wpGenerateRawHtml=1</code>, <code>&amp;wpGenerateXml=1</code>, <code>&amp;wpRemoveComments=0</code>, <code>&amp;wpRemoveNowiki=1</code>.