# typemap

## Value

An Object containing one or more properties named after the Zotero item types.

Each property should be defined as follows :

* **Name** : the property name has to follow the Zotero data scheme. An old nomenclature of item types is available [here](https://aurimasv.github.io/z2csl/typeMap.xml).
* **Value** : the property's value should be a string, corresponding to the name of the Roam tag/page to use to categorize the type of the item.

For example, defining `typemap.bookSection`  with the value `'Chapter'` will have the extension create a block `Type:: [[Chapter]]` instead of `Type:: [[Book Section]]` for items of type `bookSection`.

## Usage in the extension

The utility function `zoteroRoam.formatting.getItemType` function (which is called in [getItemMetadata](/zotero-roam/v0.6/customization/extension-defaults.md#getitemmetadata)) looks for an item type's label in `zoteroRoam_settings.typemap` (if it exists), otherwise it falls back on the extension's default typemap object (`zoteroRoam.typemap`).

{% hint style="info" %}
If you've defined your own formatting functions, and never use `getItemMetadata`, then you probably don't need `typemap` - unless you're using [zoteroRoam.formatting.getItemType](/zotero-roam/v0.6/customization/formatting/code-snippets.md#data-itemtype) in your own functions.
{% endhint %}

## Examples

:pencil2: *Assigning custom labels for a few item types :*

```javascript
// Other item types will be associated with their label from zoteroRoam.typemap

zoteroRoam_settings = {
    // dataRequests: {...},
    typemap: {
        bookSection: 'Chapter',
        conferencePaper: 'Paper',
        journalArticle: 'Paper'
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alix-lahuec.gitbook.io/zotero-roam/v0.6/customization/other/typemap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
