Page MenuHomePhabricator

Concatenate structured fields when matched to single field in extension
Closed, ResolvedPublic

Description

Copied from: https://www.mediawiki.org/w/index.php?title=Topic:Sfyremqqft60w5z6&topic_showPostId=sfyremxcyno7opj6#flow-post-sfyremxcyno7opj6

Some templates don't have structured author / editor fields and just include them all in a list. There was a request to flatten the fields.

Ideas? This goes back to the beginning of how we decided to write the template data maps and corresponding 'mediawiki' data structure.

We definitely shouldn't corrupt the existing 'mediawiki' format, especially since doing this in the backend just duplicates data. Anything like this should be done further upstream. Ideally, at the template level, but wondering if anyone had any opinions before marking this declined :).

Event Timeline

Mvolz raised the priority of this task from to Needs Triage.
Mvolz updated the task description. (Show Details)
Mvolz added projects: Citoid, TemplateData.
Mvolz moved this task to Backlog on the Citoid board.

Actually, we probably could do something like this in the extension, if the field that citoid gets is a list of lists, but the field in the template data is just a flat field, we could concatenate it.

It might be somewhat ugly though.

[[first, last],[first, last], [first,last]] becomes
first last first last first last

or
[[first, last],[first, last], [first,last]] becomes
first last, first last, first last

I also tried to write a converter template (Template:Literatur/Citoid in German wikipedia), which basically accepts the parameters as provided by the Citoid service, converts them to the proper format and passes these to our local wikis proper cite template (Template:Literatur).

As I don't want that this converter template appears in our articles I registeres it in [[MediaWiki:Citoid-template-type-map.json]] as "subst:Literatur/Citoid". However, this also does not work, as in this case it seems to be looking for an template called "Template:subst:Literatur/Citoid".

But basically, allowing entries to start with "subst:" in [[MediaWiki:Citoid-template-type-map.json]] would also be a solution.

Mvolz moved this task from Service to Extension on the Citoid board.
Mvolz set Security to None.
Mvolz triaged this task as Medium priority.May 11 2015, 10:28 AM
Mvolz renamed this task from Some templates don't support multiple author fields to Concatenate structured fields when matched to single field in extension.May 11 2015, 1:04 PM

Change 218946 had a related patch set uploaded (by Mvolz):
Allow structured citoid fields to be flattened

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

Change 218946 had a related patch set uploaded (by Mvolz):
Allow structured citoid fields to be flattened

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

Change 218946 merged by jenkins-bot:
Allow structured citoid fields to be flattened

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

OK, will close now then per standard protocol. It's tagged with the release date.