Content deleted Content added
m →cutting: emphasis |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 732:
}}
See also {{{{rel|Module:Params/doc/examples/tablebox}}}} for an example of how to exploit this function to create [[Template:Infobox|infoboxes]], and {{{{rel|Module:Params/doc/examples/four cells per row table}}}} for an example of how to exploit this function to create n-column tables.
{{vpad|clear=none}}
Line 1,146:
<syntaxhighlight lang="wikitext">{{#invoke:params|cutting|0|2|sequential|call_for_each_value|example template}}</syntaxhighlight>
If the absolute value of the sum of the two arguments (left and right cut) is greater than the number of ''sequential'' parameters available, the behavior will be the same as if the sum had been equal to the number of sequential parameters available, both when this is a positive value and when it is a negative value (with opposite results). After the desired sequential parameters have been discarded, '''all''' other positive numeric parameters will be shifted accordingly.
In some cases it might be necessary to concatenate more than one invocation of the <code>cutting</code> modifier. For instance, the following code prints the last unnamed parameter passed, but only if at least two parameters were passed:
Line 1,834:
: ''Convert all parameter values to upper case''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|
This modifier does not take arguments besides the name of the function that will follow.
Line 1,863:
If the ''call style flag'' or (if omitted) the ''template name'' is followed by one or more groups of three arguments led by the <code>let</code> keyword (i.e. <code>let|name|value</code>), these will be passed to the mapping template.
If the last group of three arguments or (if omitted) the ''call style flag'' or (if omitted) the ''template name'' is followed by a number, this will be parsed as the amount of positional parameters to add. These will always follow the current parameter's name and/or value if any of the latter
In case of collisions, the parameters assigned via the <code>let</code> keyword will be given precedence over everything else.
Line 1,949:
If the ''call style flag'' or (if omitted) the ''function name'' is followed by one or more groups of three arguments led by the <code>let</code> keyword (i.e. <code>let|name|value</code>), these will be passed to the mapping module function.
If the last group of three arguments or (if omitted) the ''call style flag'' or (if omitted) the ''function name'' is followed by a number, this will be parsed as the amount of positional parameters to add. These will always follow the current parameter's name and/or value if any of the latter
In case of collisions, the arguments assigned via the <code>let</code> keyword will be given precedence over everything else.
Line 1,992:
If the ''call style flag'' or (if omitted) the ''template name'' is followed by one or more groups of three arguments led by the <code>let</code> keyword (i.e. <code>let|name|value</code>), these will be passed to the parser function.
If the last group of three arguments or (if omitted) the ''call style flag'' or (if omitted) the ''template name'' is followed by a number, this will be parsed as the amount of positional arguments to add. These will always follow the current parameter's name and/or value if any of the latter
In case of collisions, the arguments assigned via the <code>let</code> keyword will be given precedence over everything else.
Line 2,172:
: ''Convert all parameter names to upper case''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|
This modifier does not take arguments besides the name of the function that will follow.
|