Closed chrismytton closed 7 years ago
This might actually be tricker than I initially thought. The default template will need to handle an unknown number of columns, which can currently have arbitrary names. I'm not aware of a way to iterate over a list of things in mediawiki, though there might be an extension/template that can do such things.
So for example a default template might be called in any of these forms:
{{Default row template|@@=+++|id=Q123|name=Alice}}
{{Default row template|@@=+++|wikidata_id=Q123}}
{{Default row template|@@=+++|holder_id=1|person_email=foo@example.com}}
Which means it would somehow need to know the names of the parameters the template was called with in order to output them. I'm not sure how to do that currently.
As of https://github.com/everypolitician/compare_with_wikidata/pull/56 we're now writing all the default templates out to Wikidata on the first run, so I think that fixes this issue.
At the moment the code for generating the default row template is hidden away in Ruby land. It would be better if this lived in a mediawiki template, so that it could be updated and improved without having to release a new version of the software.