User:This, that and the other/column templates

From Wiktionary, the free dictionary
Jump to navigation Jump to search

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
{{col2|en|fish|mammal|reptile|amphibian|bird<qq:technically reptile>|insect|arachnid|crustacean}}
Typically used for lists of derived and related terms.

{{der2}} and {{rel2}} redirect to {{col2}}, and so on.

Used in 134,087 entries (col + col2 through col5). col3 the most common by far.

  • Number of columns: Arbitrarily chosen by editor
  • Collapse style: Shows first 3 rows of items, then "show more" button
  • Automatic sorting: Yes
  • Allows arbitrary content (e.g. descriptive text, nested lists): No
2. auto-collapsing with items outside the template
{{der-top}}
* {{l|en|fish}}
* {{l|en|mammal}}
* {{l|en|reptile}}
* {{l|en|amphibian}}
* {{l|en|bird}} {{q|technically reptile}}
* {{l|en|insect}}
* {{l|en|arachnid}}
* {{l|en|crustacean}}
{{der-bottom}}
Has variants with different box titles (e.g. {{desc-top}}).

Used in around 13,500 entries (total of all similar templates).

  • Number of columns: 2 by default, can be overridden
  • Collapse style: NavFrame, same as translation boxes
  • Automatic sorting: No
  • Allows arbitrary content (e.g. descriptive text, nested lists): Yes
3. non-collapsing with items outside the template
{{top3}}
* {{l|en|fish}}
* {{l|en|mammal}}
* {{l|en|reptile}}
* {{l|en|amphibian}}
* {{l|en|bird}} {{q|technically reptile}}
* {{l|en|insect}}
* {{l|en|arachnid}}
* {{l|en|crustacean}}
{{bottom}}
Used in around 20,000 entries.
  • Number of columns: Arbitrarily chosen by editor
  • Collapse style: No collapse
  • Automatic sorting: No
  • Allows arbitrary content (e.g. descriptive text, nested lists): Yes

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:

  1. 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.
  2. 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.
  3. 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}}