Jump to content

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

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by BrandonXLF (talk | contribs) at 05:52, 5 September 2024 (Advanced). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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

Parameters

Input

  • |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

  • |1= - The wikitext to map parameters to. Parameters are substituted with their number removed, i.e. |itemn= becomes |item= etc. The magic word {{I}} is replaced with the current number.
  • |call= - Template to call. Parameters are passed with their number removed, i.e. |itemn= becomes |item= etc. Overrides |1=.

Concatenation

  • |sep= - Separator to add between outputs. Outer spaces can be added with {{sp}} or  .
  • |conj= - Special separator to use before the final output.

Advanced

  • |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.

Tests

Basic

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Separator

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Conjunction

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Start

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Extra

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Sparse

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Sparse and start

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Prefix

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

No first number

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

First number required

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Sparse prefix

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Sparse no first number

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Sparse first number required

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Multiple prefixes

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Prefix extra

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

No expand with nowiki

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

No expand without nowiki

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".

Call

Script error: No such module "Sandbox/BrandonXLF/Module:Map wikitext".




Usage

{{#invoke:Sandbox/BrandonXLF/Module:Map params|function_name}}