You’re reading the ZotLit v2 docs. Still on v1? Read the v1 docs

ZotLit

Template data

Every property available on the zt variable, organized by template type.

This page lists every property available on zt in each template type. Use the Template Data Explorer against your own library to discover values interactively.

Note and content templates

The zt root for the note template: every item field plus the runtime-computed fields assembled at the app layer (backlinks, resolved attachment links, flattened annotations, author conveniences).

The note body of a Profile document, and the {% managed %} block inside it, share this context.

Prop

Type

Annotation template

The zt root of the annotation template: one annotation (TemplateAnnotation) plus citation. Entries of zt.annotations on the note root carry no citation — only the single-annotation render resolves one.

The Annotation Section of a Profile document receives a single annotation as zt.

Prop

Type

Filename template

The zt root of the filename template: an item's own fields, its collections, Primary Creators, an Author Summary, and inert notePath / noteLink stubs. It reads only this item when naming a note.

The filename template in a Profile document's manifest receives exactly the properties below.

Prop

Type

Item fields

Every Zotero item field is a flat property on zt. The canonical Zotero field name is the primary accessor, and type-specific spellings normalize to their canonical base field: reach blogTitle as zt.publicationTitle and studio as zt.publisher. The type-specific spelling itself is not on zt.

Three fields carry CSL-inspired renames. Both the rename and the Zotero canonical name work:

PropertyZotero canonicalNotes
zt.abstractabstractNoteBoth zt.abstract and zt.abstractNote work
zt.containerTitlepublicationTitleBoth names work
zt.citekeycitationKeyBoth zt.citekey and zt.citationKey work

Fields by item type

Each Zotero item type exposes its own field set. Expand a type to see the zt property names it adds to the common fields above.

Prop

Type

Citation template

The citation-template data root (zt): citations[i].item === items[i].

The citation template (zotlit-citation.md) renders one in-text citation.

Pass zt.citations to the Pandoc Citation formatter, which reads prefix, suffix, suppressAuthor, locator, and labelShort, and omits entries whose item.citationKey is null.

LanguageFormExpression
Liquidnormal{{ zt.citations | pandoc_cite }}
Etanormal<%= pandocCite(zt.citations) %>
Liquidprefer-author-in-text{{ zt.citations | pandoc_cite: "prefer-author-in-text" }}
Etaprefer-author-in-text<%= pandocCite(zt.citations, "prefer-author-in-text") %>

To write LaTeX source instead, pass the same zt.citations to the LaTeX formatter. It joins every retained key into one command and takes the prenote and postnote from the first retained item. A citation that carries a prefix emits natbib's and BibLaTeX's two-argument form, \cite[see][p. 3]{smith2024}.

LanguageFormExpression
Liquid\cite{{ zt.citations | tex_cite }}
Eta\cite<%= texCite(zt.citations) %>
Liquid\autocite{{ zt.citations | tex_cite: "autocite" }}
Eta\autocite<%= texCite(zt.citations, "autocite") %>

Citation variants

The gesture a Citation was requested with, handed to the Citation Template as zt.variant: "main" for Enter, "alt" for Shift+Enter or a trailing / in the suggester query. The enum names the gesture alone — the Citation Template decides what each variant renders.

The built-in citation template renders the author-in-text form for alt and the bracketed form for main.

  • "main": Enter in the suggester, the insert modal, and an annotation's citation.
  • "alt": Shift+Enter, or a trailing / in the suggester query.

Citation item

One cited item within a Citation: the pure item data plus the citation-scoped properties, which never live on the item. Exposed to the Citation Template as zt.citations, with zt.items the same items bare.

Each entry in zt.citations. Loop over them with {% for citation in zt.citations %}.

Prop

Type

Cited item fields

A cited item's data, in the same template vocabulary as the note root and narrowed to the fields both a live Zotero item and a note's embedded CSL-JSON snapshot supply. Vault and library context — tags, dates-added/modified, library identity, and the note resolvers — stays on the note root, which the embedded snapshot cannot express. An unresolved reference becomes a stub with every field null, so a citation template never null-checks the item itself.

Each cited item also carries every item field of its type. The note-root properties it leaves behind are key, libraryID, indexedKey, tags, dateAdded, dateModified, collections, backlink, weblink, annotations, attachments, authors, authorsShort, relatedItems, notes, notePath, and noteLink.

Prop

Type

Locator label abbreviations

labelShort maps the CSL label to its Pandoc locator term. Any label not listed (including "page") yields p..

labellabelShort
bookbk.
chapterchap.
columncol.
figurefig.
foliofol.
issueno.
linel.
noten.
opusop.
paragraphpara.
partpt.
sectionsec.
sub-verbos.v.
versev.
volumevol.

Annotation entries

One annotation with its app-layer links resolved: an entry of zt.annotations on the note root, and the base of the single-annotation root AnnotationTemplateContext.

Loop over them with {% for annotation in zt.annotations %}.

Prop

Type

Annotation types

A resolved annotation type name: one Zotero declares, or "unknown" for a type id Zotero added after this mapping was written.

  • "highlight": Text marked with a highlight color.
  • "note": A note pinned to a spot on the page.
  • "image": A rectangular area selection, saved with an excerpt image.
  • "ink": A freehand drawing, saved with an excerpt image.
  • "underline": Underlined text.
  • "text": Free text typed onto the page.
  • "unknown": A type id Zotero added after this mapping was written.

Parent item

Parent literature item as seen from the standalone annotation template. The annot-view drag-insert resolves the item's tags but omits collection rows entirely — collections lives only on the note root. Read them there (zt.collections).

Prop

Type

Creators

One creator of an item, in the template vocabulary. Coerces to fullName in string contexts.

zt.creators lists every creator on the item. zt.authors lists the creators in the first populated role: the item's primary creator role, editor, director, then contributor. Institutional creators (Zotero fieldMode=1) set literal and leave family and given empty.

Prop

Type

Tags

A Tag in the template vocabulary. Coerces to name in string contexts (like a collection coerces to its name), so {{ zt.tags | join: ", " }} renders tag names directly. Zotero-internal IDs are dropped; type is the resolved name rather than Zotero's raw int.

Prop

Type

Collections

A Zotero collection an item belongs to, in the template vocabulary. Coerces to name in string contexts (like a tag coerces to its name).

Use the collection_paths filter to render the full ancestor path joined by a separator ("/" by default).

Prop

Type

Date format

zt.date is one of four parsed variants, discriminated by kind. {{ zt.date }} renders an ISO date for "date", an ISO year-month for "yearMonth", a bare year for "year", and the raw user text for "text". Use {{ zt.date | date: "%Y-%m-%d" }} for explicit formatting with strftime tokens; a "text" date renders its raw text unchanged whatever the format string.

Full date

Full Y/M/D date parsed into a Temporal.PlainDate.

Prop

Type

Year and month

Year and month only; Temporal.PlainYearMonth (no day).

Prop

Type

Year only

Year only. Also covers Zotero's 01 2003 misparse where the user-string day is meaningful but month is missing (the spurious day is dropped since no Temporal type fits "year + day without month").

Prop

Type

Text

Unparseable / text-only: the year is missing or the SQL prefix is absent.

Prop

Type

Extra field

Best-effort structured view of Zotero's extra field. Plain data so it is directly indexable in Liquid, Eta, and JS.

toString is non-enumerable, so a spread, JSON.stringify, or Object.keys sees the three data properties alone.

zt.extra is a parsed view of Zotero's free-text Extra field, or null when the field is empty. {{ zt.extra }} renders the raw field text.

Prop

Type

Extra lines

One source row of an Extra field, in document order: a parsed pair (key plus trimmed value) or a non-pair text/blank row (key: null). raw is the verbatim line so interleaved prose is never dropped.

A line splits on its first : or =, and is a pair only when the key starts with an ASCII letter and otherwise holds ASCII letters, digits, spaces, dots, hyphens, or underscores. A line that does not match, and one whose value is empty, becomes a text row.

A non-enumerable toString returns raw, as on the extra field itself.

Each entry of zt.extra.lines.

Pair row

Prop

Type

Text row

Prop

Type

Attachments

Attachment data in the v2 template vocabulary. Exposed on zt.attachments and as parentAttachment on each annotation.

Prop

Type

A single entry in relatedItems: the related item's own fields, flattened with its backlink and author conveniences. Depth-1 — its own annotations, attachments, and relatedItems are deliberately absent (resolving them would require a per-related-item DB fan-out), marking the boundary of the relation graph.

Each entry also carries every item field.

Prop

Type

Notes

A child note exposed on notes as a link only — the imported note's Markdown body lives in its own file, never inlined here. Carries a non-enumerable toString rendering its title (falling back to key), so it stringifies to a title in string contexts and previews.

See Import Zotero notes for the import workflow.

Prop

Type

Imported note frontmatter

Each imported child-note file carries four frontmatter fields:

FieldDescription
dateWhen the note was added to Zotero. Local datetime with offset at second precision (e.g. 2025-03-15T10:30:00-04:00)
zotero-note-keyIdentity key matching the imported file to the Zotero note. For group libraries, this includes the group library identifier (KEYgGROUPID)
zotero-lastmodSource note's dateModified timestamp (same format as date). Used by batch re-import to skip unchanged notes
zotlit-profileThe profile that ran the import, as its name and 12-character ID. Written only when a non-default profile ran it, and reserved like the rest

See also

Last updated on

On this page