Citoid/Maps TemplateData

Example of TemplateData skeleton with empty maps value
Below, a barebone example of templateData that shows you how the 'maps' key fits in with the rest of the templateData. 'maps' values correspond to the name of the service being used, in this case 'citoid.'. The values in the citoid object must be valid 'params' (i.e. in this case, 'foo' - aliases are not allowed); 'maps' keys, i.e. 'bar' here, correspond to keys coming from the citoid service.

Real example
This is an example of a partial 'maps' value from the Cite web template on en wiki. The full templateData can be viewed on the page source.

Available fields and field structure
A complete list of fields for each zotero type is available from the Zotero type map. These largely match the citoid fields. However, there are some exceptions.

In 'zotero' format, the field "creators" is a structured object that contains a list of creators with the creator type. In the 'mediawiki' format, the creatorType is transformed into a key. So instead of the creators key, there will be an 'editor' key as well as 'author', 'contributor', and 'translator' keys. These correspond to a two dimensional array, or matrix, which map onto the first and last names of the creators. If there is only one name for the contributor, the second value will be an empty string.

The other way mediawiki fields differ is that the values for ISSN and ISBN are lists, not strings.

On the type map, sometimes there is a base field in parentheses, i.e. websiteTitle (publicationTitle). Where this is the case, you will get the specific field type, i.e. websiteTitle, unless you request the basefield by appending the argument basefield=true to the request string. As of WMF-deploy-2016-01-12_(1.27.0-wmf.10) the citoid extension requests the baseType, i.e. the field in parens and the base field value is the one that should be used in template data.

Simple Arrays (lists)
ISSN and ISBN fields are simple lists. If you want to ensure that exactly one ISBN or ISSN goes in the field, (for example, if your template validates the ISBN or ISSN) your template data should look like so: This will result in the template:

If you want to include all available ISBNs in your template, your template should look like so: The resulting template will include all available ISBNs as a comma-separated string:

If you have multiple isbn fields that can allow a single ISBN: The resulting template will be:

Two-dimensional Arrays (list of lists)
The following fields are available as a list of lists: artist, author, contributor, composer, performer, wordsBy, cosponsor, sponsor, commenter, editor, seriesEditor, translator, bookAuthor, counsel, programmer.

For templates that have separate fields for the first and last names, the template data should be as follows: The resulting template will be:

However, not all templates have separate fields for first and last names. For templates with separate fields for each author only, the template data should be as follows: The resulting template will be:

For templates with only one field for the entire list of authors, the template data should be as follows: The resulting template will be: