Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:Sandbox/BrandonXLF/Module:Map params/doc

From Wikipedia, the free encyclopedia

{{#invoke:Map params|map}} maps parameters received by a function to wikitext using |1= or to a template call using |call=.

Usage

[edit]

{{#invoke:Map params|main|parameters}}

Parameters

[edit]

Input

[edit]
  • |prefixn= - The prefix of the parameters to process. All registered prefixes will be checked to determine if a number is present in the provided arguments. |prefix1= defaults to processing unnamed parameters.
  • |extran= - An extra parameter to pass to the wikitext or template being called. If the extra parameter is suffixed with a number (same as prefixed parameters but not checked to determine if a number is present), add the suffix (i). For example, style(i).
  • |sparse= - Set to yes to support parameter lists with gaps. Defaults to no.
  • |optnum= - Whether or not to support passing the first parameter without a number, i.e. allow it to be |prefix= rather than |prefix1=. Defaults to yes.

Map to

[edit]
  • |1= - The wikitext to map parameters to. Parameters are substituted with their number removed, i.e. |itemn= becomes |item= etc. The parameter {{{i}}} is replaced with the current index and {{{1}}} is replaced with the current unnamed parameter (if applicable).
  • |call= - Template to call. Parameters are passed with their number removed, i.e. |itemn= becomes |item= etc. The parameter {{{i}}} is the current index and {{{1}}} is the current unnamed parameter (if applicable). Overrides |1=.

Concatenation

[edit]
  • |sep= / |2= - Separator to add between outputs. To preserve leading and tailing whitespace, |2= can be used instead, or |1= when |call= is being used.
  • |conj= - Special separator to use before the final output. Outer spaces can be added with {{sp}} or  .

Advanced

[edit]
  • |expand= - Whether or not to expand templates, parser functions, extension tags, etc. after substituting parameters. This is most useful when |1= is used without <nowiki>...</nowiki> tags and can provide a slight performance advantage. Only relevant when using |1=. Defaults to yes.

See also

[edit]