Template talk:Comma-separated list
Add topic| Template:Comma-separated list is indefinitely protected from editing as it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit extended-protected}} to notify an extended-confirmed editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
| This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
| ||||||||
| This template was considered for deletion on 12 March 2025. The result of the discussion was delete Template:Bold list. |
Semicolon option?
[edit]Interesting template. It might be useful to have an option like |semi= to change the separator from a comma to a semicolon. – Jonesey95 (talk) 07:58, 16 January 2019 (UTC)
- @Jonesey95: Your slightest wish ...
{{cslist | first item | second item | third item | etc}}→- first item
- second item
- third item
- etc
{{cslist | first item | second item | third item | etc |semi=true}}→- first item
- second item
- third item
- etc
- Cheers --RexxS (talk) 17:20, 16 January 2019 (UTC)
- Groovy. I polished up the documentation. I think this will be useful. – Jonesey95 (talk) 18:08, 16 January 2019 (UTC)
A slight improvement
[edit]Hi, RexxS. Is this possible to delete the redundant commas? So it would work like {{hlist}}.
It reads | as an entry. For example:
{{cslist|first item|||}} →
|
{{cslist | {{{first item|}}} | {{{second item|}}} | {{{third item|}}} | {{{etc|}}}}} → |
EDIT: I have found a template named {{Comma separated entries}} which doesn't have such problem. What differs these two?
All the best, --Toghrul Rahimli (talk) 06:33, 18 August 2019 (UTC)
- Thanks for spotting that, Toghrul. I've fixed the issue now, so that empty items don't show up in the list.
- The purpose of {{Cslist}} and {{Hlist}} is to create genuine html lists – i.e. they are marked up in the html with
<ul>...</ul>and<li>...</li>. That helps them to be more accessible and functional for screen readers. The templates like {{Comma separated entries}} depend on Module:Separated entries, which creates plain text, not the lists that a screen reader could make use of. You can see the difference if you inspect them using the browser inspector. - So it's probably better to use {{Comma separated entries}} in running prose, but use Cslist, Hlist, etc. in infoboxes, tables, and other places where a screen reader expects a list, especially if it's a long list (perhaps more than a couple of entries). HTH --RexxS (talk) 07:39, 18 August 2019 (UTC)
- @RexxS:, thank you for your fix and detailed explanation. Helped a lot. Cheers!--Toghrul Rahimli (talk) 07:44, 18 August 2019 (UTC)
Serial comma
[edit]The option presently called |oxford= should be renamed to |serial=. But we should have |oxford=, |Oxford=, |harvard=, |Harvard= as aliases of that parameter. The generic name of "item 1, item 2, and item 3" punctuation is serial comma. People who incorrectly believe it to be a Briticism sometimes mis-call it the Oxford comma, and people who likewise incorrectly mistake it for an Americanism may call it the Harvard comma. In reality, it has no connection to countries, but rather to register and precision of usage; in particular, it is more common in formal and academic writing than in casual and journalistic writing, and even in the latter it is used when necessary to avoid ambiguity or confusion. We should allow leading-uppercase versions since writing a proper name as "oxford" or "harvard" will not come naturally to much of anyone, even if they are experienced enough at WP to understand that most parameters are given all-lowercase.
Aside: Given that WP is an example of formal (at least semi-formal) and high-precision writing, I would suggest that this parameter be on/true/yes by default, and that disabling it would instead require |serial=no (or |oxford=false or |Harvard=off or |serial=n or whatever negatory variant is supplied). But that's potentially a separate discussion. — SMcCandlish ☏ ¢ 😼 07:55, 1 September 2026 (UTC)
- Agree with both but especially the second paragraph. FaviFake (talk) 16:58, 1 September 2026 (UTC)