Module:Params/doc: Difference between revisions

Content deleted Content added
mNo edit summary
Line 385:
 
This function is used to detect the existence of flag parameters. For this reason, it is almost always accompanied by the <code>[[#sequential|sequential]]</code> modifier. For a similar function that allows the repetition of identical flags, see the <code>[[#coins|coins]]</code> function.
 
If the <code>[[#setting|setting]]</code> modifier was not placed earlier, this function will not add delimiters, but will return an indistinct blob of text in which values are sticked to each other. A header (<code>h</code>), an iteration delimiter (<code>i</code>), a last iteration delimiter (<code>l</code>), a footer (<code>f</code>), and a fallback text (<code>n</code>) can be declared via <code>[[#setting|setting]]</code> – the string assigned to the key-value pair delimiter (<code>p</code>) will be ignored.
 
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>.
Line 413 ⟶ 411:
 
A copy of the example above is available at &#123;&#123;{{rel|Module:Params/doc/examples/link to expanded template}}&#125;&#125;.
 
If the <code>[[#setting|setting]]</code> modifier was not placed earlier, this function will not add delimiters, but will return an indistinct blob of text in which values are sticked to each other. A header (<code>h</code>), an iteration delimiter (<code>i</code>), a last iteration delimiter (<code>l</code>), a footer (<code>f</code>), and a fallback text (<code>n</code>) can be declared via <code>[[#setting|setting]]</code> – the string assigned to the key-value pair delimiter (<code>p</code>) will be ignored.
 
{{vpad|1.5em|clear=none}}