Last modified: 2014-11-07 15:32:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T33597, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31597 - generate class for references list according to the number of refs
generate class for references list according to the number of refs
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Cite (Other open bugs)
unspecified
All All
: Normal normal with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-10 21:04 UTC by Bergi
Modified: 2014-11-07 15:32 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bergi 2011-10-10 21:04:18 UTC
The German Wikipedians would like to format the references list in multiple columns (http://de.wikipedia.org/wiki/Wikipedia:Umfragen/Multicol). This CSS3 technique is already used on en:wp, but there it is tied to a template.
We do not want to make the same mistake: templates are evil, mostly because another new syntax would be confusing, they cost (little) parser resources, and they would have to be spread over all articles. A native implementation would be much cleaner, and hereby I'd like to request one.

Of course it would be quite simple for us to just add some lines of code to MediaWiki:common.js, but that doesn't fulfil our requirements.
The points mostly named are:
* It should be simple: a plain <references /> should do everything automatically.
* Very few lines of references don't look good as columns. An automatic solution can't be done with templates; I'd propose counting the ref-tags to display and when the count is higher than an integer variable (configurable as a system message) a "column"-class should be added to the list tag.
* There will always be cases where the automation doesn't work or the article author wants something special. So he must be able to set the layout manually (on/off). This /could/ be done by solving Bug 6019 (which should be not that difficult, see r81865 for example), but I think a simple on/off switch per parameter would be enough.
* Different colum widths should be settable, fitting to the content (size of the ref-tags). I don't think this is automatable, it's just that there should be an option to change it.

Implementing the ref-count and fixing Bug 6019 would be enough, but I think we should implement a more specific solution that also prohibits uncontrolled usage.

I would propose the following algorithm (for each <references />-tag):
# Fetch "cite colums autonumber", "cite columns autoclass" and all "cite colums width-*" system messages. The first should contain an integer, the latter ones DOMStrings.
# Look if the references-tag has a "columns"-attribute
#* If so, look up wheter its value fetches the name of one of those "cite columns width-..." messages
#** If so, use the message content as the class name
#** Else set the class empty. E.g. values like columns="none" could be used the prevent multicoumn layout.
#* When there is no attribute, count the <ref>-tags which should get displayed in the current list. If that number is higher than (or equal to) the "cite columns autonumber"-message,
#** then use the content of the "cite columns autoclass"-message as the class name
#** else set the class empty
# Add the class name to the "class" attribute of the ol-element (behind the "references ").

This should allow the wiki admins a very precise, local configuration (with Mediawiki-messages and the local CSS files), and make the usage of this feature as simple as possible.
Comment 1 TMg 2011-10-10 21:36:38 UTC
Allowing multicolumn layouts for references is discussed for many years in the German Wikipedia. We refused this every time for multiple reasons. From all I know (I'm watching this subject for years now) the suggestion by Bergi is a perfect solution. It avoids all problems (for the moment). There will be a discussion about how "cite columns autoclass" should look like (e.g., should the "-moz-" prefix used or not?) but that should be discussed later. First, this needs to be implemented into the references/cite extension.
Comment 2 Gadget850 2014-09-24 09:42:42 UTC
See also:
Bug 51260 - Cite: Support multi-column and alternative list-style for <references /> tag (like enwiki {{reflist}})

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links