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

Simplified Chinese content is not ready. English content is shown.

Read in English
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 is a view of its own. It keeps its own item choice, so browsing here changes no template that you have open. You can reach it from several entry points.

To browse fields beside a template you are editing, use the Fields panel of the Template Workbench View instead. It shows the same fields for the view's chosen item, and it can insert a field at your cursor. See The Fields panel.

From the command palette

Run the command

Open the command palette and run:

ZotLit: 打开模板数据浏览器

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 探索模板数据. 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 探索模板数据. 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 探索模板数据. Zotero opens the explorer in Obsidian via a protocol link. The explorer opens as its own view, even while a Template Workbench View is open on another item, and that view keeps its item.

From Zotero (annotation)

In Zotero's PDF reader, right-click an annotation and select 在 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 最近. This list contains items recently updated in Zotero. Select

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

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

The explorer keeps its own choice. A choice here leaves every Template Workbench View on its item, and a choice in a Template Workbench View leaves the explorer where it is. Annotation fields use the chosen annotation and its own parent item data.

The pane title starts with the selected data and ends with

字段. 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.

The explorer's data updates automatically. To load it again, select 重新加载预览数据 from the pane menu.

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: 复制 Zotero 标识符, or select 复制 Zotero 标识符 from the file menu.
  • On an annotation row, open the more-options menu and select 复制标注标识符.
  • In the explorer, open the pane menu and select 复制 Zotero 标识符 or 复制标注标识符. 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 复制条目标识符 or 复制附件标识符. Multiple rows copy one key per line.
  • In the PDF reader, right-click an annotation and select 复制标注标识符.

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: 笔记, 标注, 笔记名称, or 引文.

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 笔记根节点, and its back button, tooltipped 返回笔记根节点, 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 作为标注模板数据进行探索.

Sections

常用字段 leads every root and holds the fields most templates use. A note root and a note name root group the remaining fields under 文献信息, 标识符, 内容与文件, 整理, 链接, and Zotero 记录. An annotation root groups them under 标注, 来源, 整理, 链接, and Zotero 记录. 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 展开所有分组 or 折叠所有分组. 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 复制路径. 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 更多; 更少 folds it back.

Filter fields

Type in the search box to narrow the list. The box names the root it searches: 搜索笔记字段, 搜索标注字段, 搜索笔记名称字段, or 搜索引文字段.

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 没有匹配的字段。清除搜索即可查看所有字段。.

Copy paths and snippets

Every row carries a menu. Open it from the row's action cluster, labelled 模板操作, or right-click the row.

Copy path

Select 复制路径 to copy the engine-neutral property path, such as zt.creators[0].lastName.

Copy value

Select 复制值 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:

  • 复制输出 renders the value, for example {{ zt.title }}.
  • 复制(如果存在) wraps the value in a conditional block.
  • 复制循环 writes each item of a list on its own Markdown list line.
  • 复制连接结果 writes every item of a list on one line, separated by commas.

An array node offers 复制循环, and 复制连接结果 where its elements join into text. Every other node offers 复制输出 and 复制(如果存在).

With JavaScript 模板 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 已复制. A failed copy shows 无法复制。请选择并复制下方的代码片段。.

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