• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Enum/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Enum
This is the template sandbox page for Template:Enum (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Separated entries (sandbox)
WarningThis template is used in system messages, and on approximately 12,000 pages.
Changes to it can cause immediate changes to the Wikipedia user interface.
To avoid major disruption, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them.

Outputs each of the parameters separated by commas and, between the second last and last, the word " and " (this can be changed with the and= parameter). Any number of parameters may be specified.

It is intended for use by other templates to output a suitably formatted list when the number of parameters varies. Named parameters, except for those specified below, are discarded.

White space in parameters is discarded. To include white space, use a character entity reference or numeric character reference.

Usage

edit

{{Enum|first|second|third| ... }}

The named parameters are:

after: The text to follow the final item. This might be a semicolon, for example. The default is to have no following text. This is not used if the list is empty (has no items).
and: The text to use where by default " and " is written. This may be overridden if there is a preference for a comma before the "and", or where it makes sense to write it in a language other than English, for example.
comma: The text to use between items except the last and one-before-last. If not specified, the default is ", ".
Any of the named parameters can be set empty; this differs from them not being present (i.e. use the default).

Examples

edit

More examples are given in the test cases.

Input Output
{{Enum}}
{{Enum|A}} A
{{Enum|A|B}} A and B
{{Enum|A|B|C}} A, B and C
{{Enum|A|B|C|D}} A, B, C and D

See also

edit
  • {{Separated entries}}
The above documentation is transcluded from Template:Enum/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Enum/sandbox&oldid=1108957751"
Last edited on 7 September 2022, at 05:06

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 7 September 2022, at 05:06 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop