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

ZotLit

Explore template data

Open the Template Data Explorer to browse available fields, copy property paths, and generate template snippets.

The Template Data Explorer shows the fields that templates receive for a Zotero item, an annotation, a note name, or a citation. Use it to look up field paths, read values, and copy ready-to-use snippets into your templates.

Open the explorer

The explorer can appear in a sidebar or beside the Template Workbench View. You can reach it from several entry points.

From the command palette

Run the command

Open the command palette and run:

ZotLit: Open template data explorer

If a literature note is active in the editor, the explorer uses that note's Zotero item. With no selected item, it shows a list of choices.

From a literature note

Right-click (or click the three-dot menu) on a literature note in the file explorer or tab, then select Explore template data. The explorer opens seeded with that note's item.

From the annotation view

In the annotation sidebar, open the more-options menu on any annotation row and select Explore template data. The explorer opens anchored at that annotation.

From Zotero (item)

ZotLit Companion, the Zotero add-on, adds these entry points in Zotero. Right-click a single item, open the ZotLit submenu, and select Explore template data. Zotero opens the explorer in Obsidian via a protocol link.

From Zotero (annotation)

In Zotero's PDF reader, right-click an annotation and select Explore Annotation in Obsidian, added by the Companion. The explorer opens in Obsidian anchored at that annotation.

Security prompt in Zotero

Zotero may show a confirmation dialog each time it opens an obsidian:// link. See Suppress the Zotero security prompt to disable it.

Choose data

Choose a built-in journal article, conference paper, book, or thesis example, or a library item under Recent. This list contains items recently updated in Zotero. Select

Search Zotero… to search your Zotero library. Selecting an item replaces the list with its fields.

Use Choose item to change the item. For annotation fields, use Choose annotation. The annotation chooser searches annotations from the selected item and six built-in examples: highlight, underline, note, text, image, and ink.

Data choices update the other linked panes. Annotation fields and previews use the chosen annotation and its own parent item data; the note keeps its selected item. Separate workbenches keep their own selections.

The pane title starts with the selected data and ends with

Fields. Annotation titles show the type, page, and a short excerpt. Built-in examples are identified in the title; with no selection, the pane uses its generic name.

Full panels have selection actions in the header. Sidebars have a small selection control near the data. Right-click the pane header to access its menu in either layout. To open the editor, fields, and preview together, select Open template workbench from the Template Workbench View's pane menu.

Data used for the preview updates automatically. To load it again, select Reload preview data from the pane menu. In On demand mode, select Run to render the preview.

Copy a Zotero key

A Zotero key identifies one object: an item, an attachment, an annotation, or a note. Copy one when a tool asks you which object to work on.

In Obsidian:

  • For the active literature note, run ZotLit: Copy item key, or select Copy item key from the file menu.
  • On an annotation row, open the more-options menu and select Copy annotation key.
  • In the explorer, open the pane menu and select Copy item key or Copy annotation key. The label follows the root the pane lists.

If a literature note is already open, you can also copy its zotero-key frontmatter value by hand.

In Zotero, the Companion adds two more entry points:

  • Right-click one or more library rows and open the ZotLit submenu. The entry names the kind you selected, such as Copy Item Key or Copy Attachment Key. Multiple rows copy one key per line.
  • In the PDF reader, right-click an annotation and select Copy Annotation Key.

One key is always enough. The root the pane lists decides which object it names: the note root copies the item key, the annotation root the annotation key.

Browse the fields

The pane lists the fields of one root, grouped under section headings.

The root the pane lists

The pane header names the root it reads: Note, Annotation, Note name, or Citation.

The root follows the part of the profile you are editing: the note body and its properties list the note root, the Annotation Section lists the annotation root, the manifest's filename value lists the note name root, and the Citation text lists the citation root.

The standalone explorer takes its root from the Template Workbench View beside it. When it is anchored at an annotation, a breadcrumb above the list reads Note root, and its back button, tooltipped Back to note root, returns the list to the note root.

To read one annotation's own fields from the note root, open the more-options menu on its row under zt.annotations and select Explore as annotation template data.

Sections

Common fields leads every root and holds the fields most templates use. A note root and a note name root group the remaining fields under Reference, Identifiers, Content and files, Organization, Links, and Zotero record. An annotation root groups them under Annotation, Source, Organization, Links, and Zotero record. A citation root has no other section yet.

Select a section heading to open or close that section. The button beside the pane's selection control opens every section or closes every one, tooltipped Expand all sections or Collapse all sections. The pane menu carries the same action.

Each top-level row shows a name a reader knows, and its raw path stays in the tooltip and in Copy path. Expand a row that holds an object or an array to read its members. A long value collapses to its first line until you select more; less folds it back.

Filter fields

Type in the search box to narrow the list. The box names the root it searches: Search note fields, Search annotation fields, Search note name fields, or Search citation fields.

A query matches field names, keys, and values by case-insensitive substring. Matching rows and their ancestor chains open automatically. When nothing matches, the list reads No matching fields. Clear the search to see all fields..

Copy paths and snippets

Every row carries a menu. Open it from the row's action cluster, labelled Template actions, or right-click the row.

Copy path

Select Copy path to copy the engine-neutral property path, such as zt.creators[0].lastName.

Copy value

Select Copy value to copy the row's current value. Primitives copy verbatim; objects and arrays copy as JSON. The item is unavailable while the row holds no value.

Copy template snippets

The same menu offers ready-to-use snippets in the syntax of your template:

  • Copy output renders the value, for example {{ zt.title }}.
  • Copy if present wraps the value in a conditional block.
  • Copy loop iterates over an array node.
  • Copy joined joins an array into a delimiter-separated string.

An array node offers Copy loop, and Copy joined where its elements join into text. Every other node offers Copy output and Copy if present.

With JavaScript templates on, the snippet items sit in two submenus, captioned "Liquid" and "Eta", so you can pick the syntax your template uses. With the gate off, the Liquid items appear directly in the menu.

A successful copy shows the notice Copied. A failed copy shows Could not copy. Select and copy the snippet below..

Reporting a template problem

To send this data with a bug report, follow Template data in Collect debug logs.

See also

Last updated on

On this page