SmartBlock templates

If you choose to use a SmartBlock to import your items' metadata, it will be triggered with the following variables:

  • item : the raw metadata for the Zotero item

  • pdfs : the raw metadata for the Zotero item's linked PDFs

  • notes : the raw metadata for the Zotero item's linked notes/annotations

These provide rich information, but are also difficult to work with directly in a SmartBlock. For that reason, you will most likely want to rely on the special helper commands that are provided by the extension.

Helper commands

The following commands should only be used inside of SmartBlocks that are triggered by zoteroRoam, as they need the variables described above to function correctly.

ZOTEROITEMABSTRACT

Returns the contents of the item's abstract

// The command takes no options


<%ZOTEROITEMABSTRACT%>
// "Lorem ipsum sed elit"

ZOTEROITEMCITATION

Returns a formatted reference for the item

ZOTEROITEMCOLLECTIONS

Returns the comma-separated list of the item's collections

ZOTEROITEMCREATORS

Returns the comma-separated list of the item's creators

ZOTEROITEMDATEADDED

Returns the DNP-formatted date on which the item was added to Zotero

Returns a link to the item within Zotero

ZOTEROITEMMETADATA

Returns the output of the extension's default metadata formatter for the item. This can be helpful if you'd like to base your template off of what the extension generates as the default, and only need to add elements around it (e.g, if you want to nest it under a parent block).

ZOTEROITEMPUBLICATION

Returns the publication details of the item

ZOTEROITEMRELATED

Returns the comma-separated list of the item's relations

ZOTEROITEMTAGS

Returns the space-separated list of the item's tags

ZOTEROITEMTITLE

Returns the item's title

ZOTEROITEMTYPE

Returns the (formatted) type of the item, from current user settings.

ZOTEROITEMURL

Returns the URL (or if unavailable, the DOI URL) of the item

ZOTEROITEMYEAR

Returns the publication year of the item

ZOTERONOTES

Returns the formatted version of the item's notes/annotations, from current user settings.

ZOTEROPDFS

Returns the comma-separated list of links to the item's PDF attachments.

Example

My personal template
  • <%ZOTEROITEMTITLE%> (<%ZOTEROITEMYEAR%>), <%ZOTEROITEMPUBLICATION%> by <%ZOTEROITEMCREATORS:existing%> <%ZOTEROITEMTAGS%>

    • <%ATTRIBUTE:Abstract%> <%ZOTEROITEMABSTRACT%>

    • <%ATTRIBUTE:Date Added%> <%ZOTEROITEMDATEADDED%>

    • <%ATTRIBUTE:Date Read%>

    • PDF links : <%ZOTEROPDFS%>

    • <%TAG:Notes%>

      • <%ZOTERONOTES%>

Here is what the output can look like:

Last updated

Was this helpful?