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 first value (representing the first name) will be an empty string, and the value will be in the second position (representing the last or second name).

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. If your template handles multiple itemTypes and you've requested mediawiki format, you should include all of the synonyms in the map.

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)
All Zotero creator types are available as a list of lists: artist, attorneyAgent, author, bookAuthor, cartographer, castMember, commenter, composer, contributor, cosponsor, counsel, director, editor, guest, interviewee, interviewer, inventor, performer, podcaster, presenter, producer, programmer, recipient, reviewedAuthor, scriptwriter, seriesEditor, sponsor, translator, wordsBy.

For 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 the template data should be as follows: The resulting template will be: