Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Delimited template list/doc

From Neodyland Wiki

This is the documentation page for Module:Delimited template list

This module expands each non-empty item in a comma-separated list through a template. Whitespace surrounding each item is removed.

The separator between expanded templates is taken from MediaWiki:Comma-separator in the wiki's content language. Local message overrides are respected.

Usage

edit
{{#invoke:Delimited template list|main
 |ex=a,b
 |template=Code
 |prefix=font=
 |suffix=
 |leading=,
}}

This produces the equivalent of:

,{{code|font{{=}}a}}{{int:comma-separator}}{{code|font{{=}}b}}

Invocation from another template

edit

When ex is not passed directly to the module, it is read from the arguments of the template containing the invocation. This allows the module to be placed inline between other template output:

{{Previous template}}{{#invoke:Delimited template list|main
 |template=Code
 |prefix=font=
 |leading=
}}{{Next template}}

If the containing template is called as {{Example|ex=a,b}}, the module uses that value automatically.

Parameters

edit
ex
Comma-separated input. If omitted, the value is read from the parent template. Empty items are ignored.
template
Template expanded once for each item. The default is Template:Code.
prefix
Text prepended to every item before it is passed as the template's first unnamed argument. The default is empty.
suffix
Text appended to every item before it is passed as the template's first unnamed argument. The default is empty.
leading
Text placed before the first expanded template. The default is a comma without a following space. Pass an empty value to suppress it.

Limitations

edit

The comma is always treated as a separator and cannot be escaped. Consequently, individual values cannot contain commas.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.