VisualEditor: Template parameters should be in TemplateData recommended order
Closed, ResolvedPublic

Description

Several users on the English Wikipedia, most recently Salix, have requested that the parameters for templates should be in the recommended order not alphabetical order.

For example in {{tracklist}} it lists "Track10" before "Track2", and in the various citation templates, "First" and "Last" should be adjacent.


Version: unspecified
Severity: enhancement

bzimport set Reference to bz51930.
Thryduulf created this task.Via LegacyJul 24 2013, 8:28 AM
SalixAlba added a comment.Via ConduitJul 24 2013, 2:07 PM

An example of this is {{Taxobox}} which has 100+ parameters. There are about 10 recommended parameters which go at the top the list and the rest of the parameters have a strict ordering depending on taxonomic hierarchy. Kingdom, Phylum, Class, Order, Family, Subfamily, Genus, Species. An example of use is http://en.wikipedia.org/wiki/Formica which gives the fields in a confusing alphabetial order (latin names are used for the fields).

A second problem is the order when no templatedata is specified. In the article http://en.wikipedia.org/wiki/Where_Does_This_Door_Go?veaction=edit
if you open up the dialog for the {{tracklist}} the parameters are listed in the order track1, track10, track11 ... track15 track2 track3 ... track9. Ideally they would be in strict numerical ordering. This would require a smarter sorting algorithm than just alphabetical.

Another note is that case insensitive sort is better than case sensitive sort as templates often have the same parameter with different capitalization, 'Image' and 'image'.

matmarex added a comment.Via ConduitJul 30 2013, 11:15 PM

Another example is [[pl:Template:Związek chemiczny infobox]] on pl.wp (infobox for chemical compounds) which has a lot of parameters which should be shown together, but which are not always alphabetically one after another. These groups are for example:

  • gęstość + gęstość źródło + stan skupienia w podanej g + g warunki niestandardowe (density, source for density, state of matter for this density, non-standard environment conditions for the density)
  • rozpuszczalność w wodzie + rww źródło + rww warunki niestandardowe (solubility in water, source, non-standard environment conditions)
Jdforrester-WMF added a comment.Via ConduitAug 30 2013, 10:09 PM

There is no such thing as "TemplateData recommended order"; the JSON block is unordered and can't be relied upon. Does this imply that we should have a "parameter order" value for TemplateData?

SalixAlba added a comment.Via ConduitAug 30 2013, 10:56 PM

There is a good case for imposing some ordering on the template parameters. Often you find some parameters naturally group together. Take for example http://en.wikipedia.org/wiki/Template:Infobox_single/doc There are various parameters which group together:
*Ones relating to the image (Cover, Alt, Caption and Border)
*Ones to do with the single chronology (Last single, This single, Next single)
for infoboxes a prefered order would generally be the order they appear in the template.

Jdforrester-WMF added a comment.Via ConduitAug 30 2013, 11:02 PM

(In reply to comment #4)

There is a good case for imposing some ordering on the template parameters.
Often you find some parameters naturally group together. Take for example
http://en.wikipedia.org/wiki/Template:Infobox_single/doc There are various
parameters which group together:
*Ones relating to the image (Cover, Alt, Caption and Border)
*Ones to do with the single chronology (Last single, This single, Next
single)
for infoboxes a prefered order would generally be the order they appear in
the
template.

Yeah, that sounds a totally reasonable thing to add. Making a bug now…

Thryduulf added a comment.Via ConduitOct 1 2013, 7:24 PM
  • Bug 53891 has been marked as a duplicate of this bug. ***
matmarex added a comment.Via ConduitNov 14 2013, 1:15 PM

The dependency has been fixed.

Is the importance of this still "Low enhancement"?

Qgil added a comment.Via ConduitDec 10 2013, 1:59 AM

After filling/testing a couple of templates in ca.wikipedia.org, it looks like the current behavior is the following:

  • Required fields are sorted by the order they are listed in the template data.
  • Optional files are sorted alphabetically.

Please sort everything following the same sequence used in the template data. Usually this is the same order used in the "old" documentation, which in turn tends to follow the order in which the information is presented.

TrevorParscal added a comment.Via ConduitJan 14 2014, 8:19 PM

Resolved in Ic3eb665389380c8e3dd6562b059c2f6655a22588

gerritbot added a comment.Via ConduitJan 14 2014, 8:19 PM

Change 107428 had a related patch set uploaded by Trevor Parscal:
Use paramOrder data for ordering template parameters

https://gerrit.wikimedia.org/r/107428

gerritbot added a comment.Via ConduitJan 15 2014, 2:58 AM

Change 107428 merged by jenkins-bot:
Use paramOrder data for ordering template parameters

https://gerrit.wikimedia.org/r/107428

Add Comment