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

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

Usage

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

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

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

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

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.