Page MenuHomePhabricator

Add fallback classes for information fields in TemplateParser
Closed, ResolvedPublic

Description

TemplateParser currently looks for classes for license templates, and IDs for information fields, because that's how most of the information is organized on Commons.

Now that we're in the process of spreading machine-readable to as many files as possible on Commons and all other wikis with file uploads, we're running into situations where the information template isn't necessarily built with a table (example: https://commons.wikimedia.org/wiki/Template:Audio_upload ). The table+ID approach doesn't work for those.

It would be great if TemplateParser could look for regular classes, in addition to IDs, when looking for information-like data. From a user perspective, it would be simpler if the classes had the same name as the IDs, but if it's not possible / preferable from a development standpoint, it's not a big problem.


Version: master
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:52 AM
bzimport added a project: CommonsMetadata.
bzimport set Reference to bz73332.
bzimport added a subscriber: Unknown Object (MLST).

In addition to templates not using tables, classes would also be useful for templates that do use tables but whose cells already have IDs, like w:Template:Non-free media data.

Gilles triaged this task as Medium priority.Nov 24 2014, 1:38 PM
Gilles subscribed.

After discussing with @Tgr, I've added those classes to Template:Non-free media data to be able to test them.

Any of the files using that template can be used as a test case, for example File:Fourth Doctor.jpg.

Change 176215 had a related patch set uploaded (by Gerg? Tisza):
Refactor information template parsing to better support multiple templates

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

Patch-For-Review

Change 176215 merged by jenkins-bot:
Refactor information template parsing to better support multiple templates

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