Content deleted Content added
Amend incorrect statement |
Function rename: `trimmed` -> `cut` – Update doc |
||
Line 69:
Without modifiers this function is similar to writing <syntaxhighlight lang="wikitext" inline>{{{parameter name|}}}</syntaxhighlight> – with optional header and footer to be displayed only when the parameter is found. With modifiers, however, it allows to reach parameters that would be unreachable without knowing their number in advance. For instance, writing
<syntaxhighlight lang="wikitext">{{#invoke:params|
will write the value of the second-last sequential parameter, independently of how many parameters the template was called with. If no matching parameter is found this function expands to nothing.
Line 315:
{{vpad|1.5em}}
=== <code>
; Brief
: ''Remove zero or more parameters from the beginning and the end of the parameter list''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|
The first argument indicates how many sequential parameters must be removed from the beginning of the parameter list, the second argument indicates how many sequential parameters must be removed from the end of the parameter list. If any of the two arguments is a negative number its absolute value indicates what must be left ''on the other side'' – i.e. <syntaxhighlight lang="wikitext" inline>{{#invoke:params|
Example:
<syntaxhighlight lang="wikitext">{{#invoke:params|
In some cases it might be necessary to concatenate more than one invocation of the <code>
<syntaxhighlight lang="wikitext">{{Hatnote|{{{altphrase|Foobar see also}}}: {{#if:{{{1|}}}
|[[{{{1}}}]]{{#invoke:params|sequential|
|{{Error|{{tl|Foobar see also}} requires at least one page name}}
}}
}}</syntaxhighlight>
{{A note|Suggestion:}} Although <syntaxhighlight lang="wikitext" inline>{{#invoke:params|
{{vpad}}
|