Changes
Jump to navigation
Jump to search
m
→Parameter list: expand
{{Module rating|protected}}
{{high-risk|208499}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
== Usage ==
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}||$B=''template body''|$params=''parameters''}}</code>
Infoboxes should never be substituted. A trick to avoid that is to make a template substitute to its transcluded form. This module is similar to [[Module:Unsubst]]. ''parameters'' is a comma-separated list of the names of parameters the invoking infobox template can take.
== Parameter list ==
; $B
: The content of the template, as it would be without the module being used.
; $params
: A comma-separated list of template parameters, without any aliases.
; $aliases
: A comma-separated list of parameter replacements, in the format <code>old1>new1,old2>new2</code>.
; $extra
: A comma-separated list of any parameters listed in $params which don't need to be shown after substitution unless they are already being used in the template; i.e. if a parameter is in both lists and is not used or blank in a particular transclusion, then on substitution the parameter will not be displayed.
; $set1
: A shorter list of parameters, comma-separated. If all the parameters used in a transclusion are in this list, then this will be used to generate the parameter names instead of ($params − $extra). This might be used if an infobox has multiple parameters that are only applicable to some group of articles.
; $set2
: Same as $set1, but only used if some of the parameters are not in $set1.
; $set3
: Same as $set2, but only used if some of the parameters are not in $set2 (i.e. all parameters are in this list, some parameters are not in $set1, and some parameters are not in $set2).
; $indent
: The number of additional spaces before each line. Useful for child infoboxes.
; $flags
: A list of comma-separated flags. The only valid input for this parameter at present is "override", which tells the template to supersede the original input to the template with any parameters which are set in the module; i.e. if the template transclusion uses {{para|number|6}} but the module invocation uses {{para|date|7}}, if the module invocation contains <code>override</code> in {{para|$flags}} then the output will be {{para|date|7}} and if it doesn't then the output will be {{para|date|6}}.
All other parameters are treated as input to the template. If the input value is not blank and the input parameter is a valid parameter of the template, then the value will appear in the post-substitution content if the transclusion's value is blank; if the module invocation contains <code>override</code> in {{para|$flags}} then the value will appear in the post-substitution content regardless of what the transclusion's value is.
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
}}</includeonly>
{{high-risk|208499}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
== Usage ==
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}||$B=''template body''|$params=''parameters''}}</code>
Infoboxes should never be substituted. A trick to avoid that is to make a template substitute to its transcluded form. This module is similar to [[Module:Unsubst]]. ''parameters'' is a comma-separated list of the names of parameters the invoking infobox template can take.
== Parameter list ==
; $B
: The content of the template, as it would be without the module being used.
; $params
: A comma-separated list of template parameters, without any aliases.
; $aliases
: A comma-separated list of parameter replacements, in the format <code>old1>new1,old2>new2</code>.
; $extra
: A comma-separated list of any parameters listed in $params which don't need to be shown after substitution unless they are already being used in the template; i.e. if a parameter is in both lists and is not used or blank in a particular transclusion, then on substitution the parameter will not be displayed.
; $set1
: A shorter list of parameters, comma-separated. If all the parameters used in a transclusion are in this list, then this will be used to generate the parameter names instead of ($params − $extra). This might be used if an infobox has multiple parameters that are only applicable to some group of articles.
; $set2
: Same as $set1, but only used if some of the parameters are not in $set1.
; $set3
: Same as $set2, but only used if some of the parameters are not in $set2 (i.e. all parameters are in this list, some parameters are not in $set1, and some parameters are not in $set2).
; $indent
: The number of additional spaces before each line. Useful for child infoboxes.
; $flags
: A list of comma-separated flags. The only valid input for this parameter at present is "override", which tells the template to supersede the original input to the template with any parameters which are set in the module; i.e. if the template transclusion uses {{para|number|6}} but the module invocation uses {{para|date|7}}, if the module invocation contains <code>override</code> in {{para|$flags}} then the output will be {{para|date|7}} and if it doesn't then the output will be {{para|date|6}}.
All other parameters are treated as input to the template. If the input value is not blank and the input parameter is a valid parameter of the template, then the value will appear in the post-substitution content if the transclusion's value is blank; if the module invocation contains <code>override</code> in {{para|$flags}} then the value will appear in the post-substitution content regardless of what the transclusion's value is.
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
}}</includeonly>