User:This, that and the other/column templates
Current state
[edit]Benwing wrote at WT:RFDO#remove_lesser-used_column_templates:
I think there should only be three sets of templates: (1) auto-collapsing with items inside the template:
{{col}}
,{{col2}}
, etc.; (2) auto-collapsing with items outside the template:{{ctop}}
,{{ctop2}}
, etc.; (3) non-collapsing with items outside the template:{{top2}}
, etc..
Here are the three styles of column templates:
1. auto-collapsing with items inside the template |
|
Typically used for lists of derived and related terms.
Used in 134,087 entries (col + col2 through col5). col3 the most common by far.
|
---|---|---|
2. auto-collapsing with items outside the template |
|
Has variants with different box titles (e.g. {{desc-top}} ).
Used in around 13,500 entries (total of all similar templates).
|
3. non-collapsing with items outside the template |
|
Used in around 20,000 entries.
|
Problems with current state
[edit]The biggest problem is arbitrary choice of the number of columns. It is down to personal editor preference. Three columns is the most favoured, but on large screens these columns still get spread across the screen in an ungainly manner.
Collapsible boxes are used even when there are very few items. See colloquial#Derived terms for an example.
Also, style 2 is relatively little used and there is no particular reason why it should coexist with style 1.
Proposed state
[edit]Here are my proposals:
- Remove all variants of these templates that specify a predefined number of columns. Instead, the column width should be specified, perhaps as one of three options (normal, narrow, wide). Or Lua code could even keep track of the longest entry and automatically pick a column width.
- An algorithm to be developed.
- Consider using a regular list where there are few items. For example, a future state of the style 1 template, e.g.
{{term list}}
(or whatever we call it), could just generate an ordinary, single-column bulleted list when three or four items are provided, but it would generate the multi-column list when the number of items is longer.- Done already in Module:term list, which is used by
{{derived terms}}
.
- Done already in Module:term list, which is used by
- Retire style 2 (auto-collapsing with items outside the template) from most places where it is used. There are likely to be some complex situations that need manual effort, but in most cases,
{{col2}}
would be a suitable replacement. Note that{{col2}}
does not require a title – this should be redundant to the L3 header ("Derived terms") in most cases anyway.- Note that there may still be a need for a style ("Style 1b"?) where the items are kept outside the template, to allow for complex nested lists etc. However, this style should be implemented to match the look of style 1 instead of using NavFrame.
- To take one of the many style 2 templates: 1876 instances of
{{der-top}}
across 1675 entries could be converted to{{derived terms}}
without any loss of info. A further 219 instances would require manual attention, and only a handful of these do things that are unsupported by{{derived terms}}
. (This analysis excludes 1559 entries that use{{der-top}}
with a custom title; many of these titles can simply be removed, as they add no additional info.)
Examples
[edit]A list with few items:
{{term list|en|reptile|fish|mammal}}
A list with many items (you can see that the JavaScript "show more/show less" toggle would need repairs to work properly on narrow screens - not terribly difficult):
{{term list|en|fish|mammal|reptile|amphibian|bird<qq:technically reptile>|insect|arachnid|crustacean|hydra|fungi|eukaryote|prokaryote|worm}}