Zotero Integration – Import Templates?

---
aliases: ["{% if authors %}{% for author in authors %}{{author}}{%- endfor %}{% endif %} ({{date | format("YYYY")}}) {{title}}{{caseTitle}}"]
{%if shortTitle %}Title: "{{shortTitle}}"{%else%}Title: "{{title}}{{caseTitle}}"{% endif %}
{%- if bookTitle %}
BookTitle: "{{bookTitle}}" {%- endif %}{%if rights%}
Impression: {{rights}}{%endif%}
tags: zotero, literature-notes, reference
Type: {{itemType}}
---
# {% if authors %}{% for author in authors %}{{author}}{%- endfor %} {% endif %}({{date | format("YYYY")}}{{dateDecided}}) {{title}}{{caseTitle}}
## Abstract
{{abstractNote}}
> [!header]+
> > [!important]-
> > ```dataview
> > Table rows.important as ""
> > where file.name = this.file.name
> > group by tag
> 
> > [!metadata]-
> > [[Index]] 
> > {% if authors %}{% for author in authors %}{{author}}{%- endfor %} {% endif %}({{date | format("YYYY")}}{{dateDecided}}) {{title}}{{caseTitle}}
> > {% for c in creators %}{% if loop.first %}{{c.creatorType | capitalize}}s:: {% endif %}[[{{c.firstName|replace(".", "")}} {{c.lastName|replace(".", "")}}]]{% if not loop.last %}, {% endif %}{% endfor %} 
> > {% if itemType %}Item_Type:: [[{{itemType}}]]{%- endif %}
> > {% if bookTitle %}Book:: [[{{bookTitle}}]]{%- endif %} {% if proceedingsTitle %}
> > Proceedings_Title:: [[{{proceedingsTitle}}]]{%- endif %} {%- if caseName %}
> > Case_Name:: [[{{caseName}}]]{%- endif %}{%- if jurisdiction %}
> > Jurisdiction:: [[{{jurisdiction}}]]{%- endif %}{%- if court %}
> > Court:: [[{{Court}}]]{%- endif %} {%- if date %}
> > Year:: [[{{date | format("YYYY")}}]]{%- endif %}{%- if dateDecided %}
> > Year:: [[{{yearAsVolume}}]]{%- endif %}{%- if url %}
> > URL:: {{url}}{%- endif %}{%- if doi %}
> > DOI:: [[{{doi}}]]{%- endif %}{%- if citekey %}
> > Citekey:: {{citekey}}{%- endif %}{% if tags %}
> > Subjects:: {% for t in tags %}[[{{t.tag}}]]{% if not loop.last %}, {% endif %}{% endfor %} {% endif %}{%- if relations.length %}
> > Related:: {% for r in relations %} [[{{r.citekey}}]]{% if not loop.last %}, {% endif %} {% endfor %}{%- endif %}{% if editors %}
> > Editors:: {% for c in creators %}{% if c.creatorType=="editor" %}[[{{c.firstName|replace(".", "")}} {{c.lastName|replace(".", "")}}]]{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% endif %} {% if translators %}
> > Translators:: [[{{translators|replace(".", "")}}]] {% endif %}{%- if rights %}
> > Verdict:: [[{{rights}}]] {%- endif %} {%- if attachments %}
> > Attachments: {%- for a in attachments | filterby("path", "endswith", ".pdf") %}
> > [{{a.title}}](file://{{a.path | replace(" ", "%20")}})  {%- endfor -%}.{%- endif %}
> 
> > [!reading]-
> > ```dataview
> > task from #todo/readinglist 
> > where file.name = this.file.name
> > ```
> > ```dataview
> > task from #researchprompt
> > where file.name = this.file.name
> > ```
## Annotations

{% for a in annotations %}{% if a.annotatedText %}{% if a.type == "underline" %}
{% if a.colorCategory == "Yellow" %}#example::[[Example]]<span class="example">"{{a.annotatedText}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.pageLabel}})
{% elif a.colorCategory == "Gray" %}### {{a.annotatedText}}{% elif a.colorCategory == "Blue" %}#### {{a.annotatedText}}{% elif a.colorCategory == "Cyan" %}#### {{a.annotatedText}}{% elif a.colorCategory == "Purple" %}##### {{a.annotatedText}}{% elif a.colorCategory == "Magenta" %}##### {{a.annotatedText}}{% elif a.colorCategory == "Orange" %}###### {{a.annotatedText}}{% else %}### {{a.annotatedText}}{% endif %}{% elif a.type == "strike" %}#### {{a.annotatedText}}{% elif a.color=="#434343" %}#### {{a.annotatedText}} {% elif a.tag=="h1" %}### {{a.annotatedText}} {% elif (a.color=="#767676") or (a.color=="#000000") %}##### {{a.annotatedText}} {% elif a.color=="#aaaaaa" %}### {{a.annotatedText}} {% elif (a.color=="#ffffff") or (a.colorCategory=="White") or (a.color=="#e56eee") -%}#### {{a.annotatedText}}{% elif (a.color=="#000000") or (a.colorCategory=="Black") -%}##### {{a.annotatedText}}
{% elif (a.color=="#37e5ff") or (a.color=="#38e5ff") or (a.color=="#2ea8e5") or (a.color=="#7fffff") or (a.colorCategory=="Cyan") %}#important:: [[Important]]  <span class="important">"{{a.annotatedText}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.pageLabel}})
{% elif (a.color=="#a33086") or (a.color=="#a32f86") or (a.color=="#a28ae5") or (a.color == "#bf7fbf") or (a.colorCategory=="Magenta") or (a.colorCategory=="Purple") %}#critique:: [[Critique]]  <span class="critique">"{{a.annotatedText}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.pageLabel}})
{% elif (a.color=="#ffc09e") %}- [ ] #therapy::[[Followup]]<span class="therapy">{{a.annotatedText}}</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.pageLabel}})
{% elif (a.color=="#fb88ff") or (a.color=="#ff809d") or (a.color=="#0000ff") or (a.color=="#ff7fff") or (a.colorCategory=="Pink") or (a.colorCategory=="Blue")%}#confusion:: [[Confusion]]  <span class="confusion">"{{a.annotatedText}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% elif (a.color=="#f19837") or (a.color=="#ff6f01") or (a.color=="#ffc09e") or (a.color=="#ffbf7f") or (a.color == "#ff7002") or (a.colorCategory=="Orange") %}#idea:: [[Idea]]  <span class="idea">"{{a.annotatedText}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.pageLabel}})
{% elif a.color=="#cccccc" or (a.color=="#aaaaaa") or (a.colorCategory=="Gray") %}#argument:: [[Argument]]  <span class="argument">"{{a.annotatedText}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.pageLabel}})
{% elif (a.color=="#fbf485") %}#example::[[Example]]<span class="example">"{{a.annotatedText}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.pageLabel}})
{% elif (a.color=="#ff6666") or (a.color=="#e52237") or (a.color=="#ff6666") or (a.color=="#e52136") or (a.color=="#ff7f7f") or (a.colorCategory=="Red") %}#disagreement:: [[Disagreement]]  <span class="disagreement">"{{a.annotatedText}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.pageLabel}})
{% elif (a.color=="#6ad928") or (a.color=="#5fb236") or (a.color=="#69d927") or (a.color=="#c5fb71") or (a.color=="#7fff7f") or (a.color=="#5fb236") or (a.colorCategory=="Green") %}- [ ] #todo/readinglist {{a.annotatedText}} [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% elif (a.color=="#ffff7f") or (a.color=="#ffd400") or (a.colorCategory=="Yellow") %}"{{a.annotatedText}}" [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}}) 
{% else %}"{{a.annotatedText}}" [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% endif %}{% endif %}
{%- if a.imageRelativePath %}![[{{a.imageRelativePath}}]]{%- endif %}
{% if a.comment %}
{% if (a.color=="#37e5ff") or (a.color=="#38e5ff") or (a.colorCategory=="Cyan") %}> [!important]+ 
> #important:: [[Important]] [[Cat]] <span class="important">"{{a.comment}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% elif (a.color=="#a33086") or (a.color=="#a32f86") or (a.color=="#a28ae5") or (a.color=="#a28ae5") or (a.colorCategory=="Purple") %}> [!critiques]+ Critique
> #critique:: [[Critique]] [[Cat]] <span class="critique">"{{a.comment}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% elif (a.color=="#e56eee") or (a.color=="#e56eee") or (a.color=="#fb88ff") or (a.color=="#ff809d") or (a.color=="#0000ff") or (a.colorCategory=="Magenta") or (a.colorCategory=="Blue")%}> [!confusion]+
> #confusion:: [[Confusion]] [[Cat]] <span class="confusion">"{{a.comment}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% elif (a.color=="#f19837") or (a.color=="#ff6f01") or (a.color=="#f19837") or (a.color=="#ffc09e") or (a.color == "#ff7002") or (a.colorCategory=="Orange") %}> [!ideas]+ Idea
> #idea:: [[Idea]] [[Cat]] <span class="idea">"{{a.comment}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% elif (a.color=="#cccccc") or (a.color=="#") or (a.colorCategory=="Gray") %}> [!arguments]+ Argument
> #argument:: [[Argument]] [[Cat]] <span class="argument">"{{a.comment}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% elif (a.color=="#ff6666") or (a.color=="#e52237") or (a.color=="#e52136") or (a.colorCategory=="Red") %}> [!disagreements]+ Disagreement
> #disagreement:: [[Disagreement]] [[Cat]] <span class="disagreement">"{{a.comment}}"</span> [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% elif (a.color=="#6ad928") or (a.color=="#5fb236") or (a.color=="#69d927") or (a.color=="#c5fb71") or (a.colorCategory=="Green") %}> [!reading]+ To Read
> - [ ] #todo/readinglist {{a.comment}} [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% else %}> [!comment]+
> [[Cat]]{{a.comment}} [p.{{a.pageLabel}}](zotero://open-pdf/library/items/{{a.attachment.itemKey}}?page={{a.page}})
{% endif %}{% endif %}{% endfor %}
{%- if markdownNotes %}
{{formattedAnnotations}}{{markdownNotes}}{%- endif -%}.
## Data
> [!footer]+
> 
> 
> > [!important]-
> > ```dataview
> > Table rows.important as ""
> > where file.name = this.file.name
> > group by tag
> > ```
> 
> 
> > [!ideas]-
> > ```dataview
> > Table rows.idea as ""
> > where file.name = this.file.name
> > group by tag
> > ```
> 
> 
> > [!disagreements]-
> > ```dataview
> > Table rows.disagreement as ""
> > where file.name = this.file.name
> > group by tag
> > ```
> 
> 
> > [!confusion]-
> > ```dataview
> > Table rows.confusion as ""
> > where file.name = this.file.name
> > group by tag
> > ```
> 
> 
> > [!critiques]-
> > ```dataview
> > Table rows.critique as ""
> > where file.name = this.file.name
> > group by tag
> > ```
> 
> 
> > [!arguments]-
> > ```dataview
> > Table rows.argument as ""
> > where file.name = this.file.name
> > group by tag
> > ```
> 
> 
> > [!reading]-
> >```tasks
> > not done
> > (description includes todo) OR (description includes researchprompt)
> > filename includes {{citekey}}
> > ```




Here’s what it looks like:

it uses notion colour blocks plugin (GitHub - deathau/obsidian-snippets) to have different coloured texts. Comments are in callouts.

The highlight colours correspond to these tags:
Screenshot 2023-12-20 190030

Separate Callouts with dataview lists at the end of the template consolidate the different coloured highlights so that the annotations don’t need to be separated by colour and can be read either in context from the main text or together with other highlights of the same colour from within obsidian.

8 Likes

Hi there, this seems great. Do you happen to know the colour codes for the updated Zotero highlight colours (Magenta, Orange, and Brown)? I reckon these will add to customisation options but have been unable to find their hex code.

I think you can find it using Data Explorer function. Browse through the highlights metadata to find the hex code

Hya espalia,

I have adopted your template (although without grouping as that results in even worse issues for some reason) because its pretty close to what I intend, but I am encountering issues where callouts do not contain the entire comment if a comment has a list structure:

Source in Zotero:


You see here two sets of notes. The upper one is formatted as a standard list which would be renderable in markdown - item X), the lower one just uses paragraphs and doesn’t use a list syntax (- is missing)

When importing, I get this result:


Suggesting that lists are broken.

I don’t know why that is the case, nor do I know how to fix it. I’m having enough trouble understanding the nunjucks syntax as is, hence I’m posting here hoping someone has an answer.

Try putting an empty line (\n for ‘new line’ could be what you need) before your comments.

Do you mean in Zotero while annotating, or in the template within obsidian?

In the Template, of course.

I try to use this exact same template and it can’t generate the information like in the template.
The picture shows what the plugin generate.
Can someone please help me?

2 Likes

Here’s my template, inspired by @mgmeyers and @erazlogo. However, I only use callouts for the info and the abstract. The annotations and comments are formatted as a bullet list, where comments are listed in bold before the highlight they belong to, which is indented below and highlighted using ==highlight==. If a highlight has tags, those are listed next to the highlight.

EDIT: A new and improved version of this template is available here: Zotero Integration – Import Templates? - #105 by Feralflora

The annotations are grouped by color under different headings.

---
citekey: {{citekey}}
aliases: [{% if shortTitle %}"{{shortTitle | safe}}"{% else %}"{{title | safe}}"{% endif %}]
title: "{{title}}"
authors: {{authors}}
tags: [literature-note, {% for t in tags %}{{t.tag}}{% if not loop.last %}, {% endif %}{% endfor %}]
year: {{date | format("YYYY")}}
publisher: "{{publicationTitle}}"
doi: {{DOI}}
---

# [{{title}}]({{desktopURI}})

> [!info]+
>{% if bibliography %}**Bibliography:** {{bibliography}}{% endif %}
>
>**Page-no:** {% for annotation in annotations %}{% if loop.first %}{{annotation.pageLabel}}{% endif %}{% endfor %}
>
>{% if hashTags %}**Tags:** {{hashTags}}{% endif %}
>
>{%- for attachment in attachments | filterby("path", "endswith", ".pdf") %}**PDF:** [{{attachment.title}}](file:///{{attachment.path | replace(" ", "%20")}}){%- endfor %}
>
>[**Open in Zotero**]({{desktopURI}})
>[**Open DOI**](https://doi.org/{{DOI}})

> [!abstract]-
> {% if abstractNote %}
> {{abstractNote|replace("\n"," ")}}
> {% endif %}
 
---

## Notes
{% macro heading(color) -%}
{%- if color == "#5fb236" -%}
💡 Main ideas, contributions and conclusions
{%- endif -%}
{%- if color == "#2ea8e5" -%}
❔ Questions
{%- endif -%}
{%- if color == "#ffd400" -%}
⭐ Important
{%- endif -%}
{%- if color == "#a28ae5" -%}
🧩 Definitions and concepts
{%- endif -%}
{%- if color == "#ff6666" -%}
⛔ Weaknesses and caveats
{%- endif -%}
{%- endmacro -%}


{% persist "annotations" %}
{% set annotations = annotations | filterby("date", "dateafter", lastImportDate) -%}
{% if annotations.length > 0 %}

*Imported on {{importDate | format("YYYY-MM-DD HH:mm")}}*

{% for color, annotations in annotations | groupby("color") -%}

### {{heading(color)}}

{%- for annotation in annotations -%}
{%- if annotation.imageRelativePath %}
![[{{annotation.imageRelativePath}}]]
{%- endif %}
{%- if annotation.comment %}
- **{{annotation.comment}}:**
	- =={{annotation.annotatedText | nl2br}}== [(p. {{annotation.pageLabel}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}}) {% if annotation.hashTags %}{{annotation.hashTags}}{% endif %}
{%- elif annotation.annotatedText %}
- =={{annotation.annotatedText | nl2br}}== [(p. {{annotation.pageLabel}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}}) {% if annotation.hashTags %}{{annotation.hashTags}}{% endif %}
{%- endif -%}{%- endfor %}

{% endfor -%}
{% endif %}
{% endpersist %}

{{abstractNote|replace("\n"," ")}} The replace filter ensures that the abstract stays within the callout even though it may have linebreaks in Zotero. Structured abstracts with headings tend to cause this issue. The workaround is achieved by replacing linebreaks with a single space.

Screenshots

Info and abstract:

Comments and their nested highlights, with tags:

Folded headings

Theme

If someone is curious, the theme I am using in the screenshots is the Polka theme.

11 Likes

Thanks! I tried several templates before I found this one which I really like.
However, I have a question. I like the idea of grouping highlights by topic, but I want to try without the grouping. How can I cancel it?

Glad you liked it!

I haven’t tried that myself, but in that case, I would make a copy of the template, and then remove the macro for grouping, and then remove these two lines:

{% for color, annotations in annotations | groupby("color") -%}

### {{heading(color)}} <br>

and the last {% endfor -%}.

I think that should do the trick.

By making a copy, you can easily switch back to the template with grouping if you prefer that.

2 Likes

A neat trick if you want to define comments as tasks while annotating in Zotero is to change the comment line in the template to the following:
- {{annotation.comment|replace("todo ","[ ] ")}}:

Then, at the start of a comment which you want Zotero Integration to convert into a task, type todo. Any comment that starts with todo, will have the word todo replaced by square brackets [ ] , which turns it into a task according to markdown syntax, as the comments are already in a bullet list, so it becomes - [ ].

You can use any keyword you want to trigger this behavior, just change the template and workflow accordingly and replace todo with something else.

Note that I had to forgo making the comments bold for this to work. Maybe someone knows a workaround that could achieve both?

3 Likes

Hi, thanks for sharing a fascinating format! I do love it.

But, I am struggling with exchanging the position of annotation and comments.
For now, when I integrate Zotero into obsidian, my comment appears first followed by highlighted texts.

But, I want to make the highlighted texts come first and then my comments appear below since I don’t put comments for every highlighted text.

Could you help me with this?

1 Like

As is, the template should handle the absence of comments fine, because highlights without comments are listed un-indented.

But if you want comments below highlights, you can rearrange the template like so. I haven’t tested this, so please report back on how it works:

{%- for annotation in annotations -%}
{%- if annotation.imageRelativePath %}
![[{{annotation.imageRelativePath}}]]
{%- endif %}
{%- if annotation.comment %}
- =={{annotation.annotatedText | nl2br}}== [(p. {{annotation.pageLabel}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}}) {% if annotation.hashTags %}{{annotation.hashTags}}
	- {{annotation.comment|replace("todo ","[ ] ")}}{% endif %}
{%- elif annotation.annotatedText %}
- =={{annotation.annotatedText | nl2br}}== [(p. {{annotation.pageLabel}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}}) {% if annotation.hashTags %}{{annotation.hashTags}}{% endif %}

{%- endif -%}{%- endfor %}

{% endfor -%}
{% endif %}
{% endpersist %}
1 Like

@Gewerd - this may be a fix for your issue. I don’t make comments in Zotero, so that is uncharted territory for me

1 Like

[‘general.magenta’, ‘#e56eee’],

[‘general.orange’, ‘#f19837’],

[‘general.gray’, ‘#aaaaaa’]

1 Like

I have made a template by randomly combining all the templates above
after trial and error, it worked.

---
cssclass: 
- research-note
- wide-page 
type: "{{itemType}}"{% for type, creators in creators | groupby("creatorType") -%}{% if loop.first %}
{% endif %}{{type | replace("interviewee", "author") | replace("director", "author") | replace("presenter", "author") | replace("podcaster", "author") | replace("programmer", "author") | replace("cartographer", "author") | replace("inventor", "author") | replace("sponsor", "author")  | replace("performer", "author") | replace("artist", "author")}}: "{%- for creator in creators -%}{%- if creator.name %}{{creator.name}}{%- else %}{{creator.lastName}}, {{creator.firstName}}{%- endif %}{% if not loop.last %}; {% endif %}{% endfor %}"{% if not loop.last %}
{% endif %}{%- endfor %}{% if title %}
title: "{{title}}"{% endif %}{% if publicationTitle %}
publication: "{{publicationTitle}}"{% endif %}{% if date %}
date: {{date | format("Do MMM- YYYY")}}{% endif %}{% if archive %}
archive: "{{archive}}"{% endif %}{% if archiveLocation %}
archive-location: "{{archiveLocation}}"{% endif %}
citekey: {{citekey}}
---


[online]({{uri}}) [local]({{desktopURI}}) {%- for attachment in attachments | filterby("path", "endswith", ".pdf") %} [pdf](file://{{attachment.path | replace(" ", "%20")}})
{% if loop.last %}
{% endif %}{%- endfor %}

{% if tags.length > 0 -%}{% for t in tags -%}#{% if t.tag == "secondary" %}source/secondary{% if not loop.last %}{% endif %}{% elif t.tag == "primary" %}source/primary{% if not loop.last %}{% endif %}{% elif "-project" in t.tag %}project/{{t.tag | lower | replace(" ", "-") | replace("-project", "")}}{% else %}subject/{{t.tag | lower | replace(" ", "-")}}{% endif %}{% if not loop.last %}
{% endif %}{%- endfor %}{%- endif %}

### Index
start-date:: {% if date %}{{date | format("Do MMM- YYYY")}}{% endif %}
end-date::
## Annotations
{% persist "annotations" %}
{% set annots = annotations | filterby("date", "dateafter", lastImportDate) -%}
{% if annots.length > 0 %}
{% for annot in annots -%}

{#-**Annotations that start with #, to be turned into markdown style section headers**-#}
{% if annot.annotatedText and "#" in annot.annotatedText %}
{{annot.annotatedText|nl2br|lower|title}}

{#-**Regular text annotations w/ page number and page link**-#}
{%- elif annot.annotatedText %}

- <mark style="background: {{annot.color}}">{{annot.annotatedText | nl2br}}</mark>  [(pg. {{annot.page}})](zotero://open-pdf/library/items/{{annot.attachment.itemKey}}?page={{annot.page}}) {#**page link**#}

{%- endif -%}

{#-**Image annotations**-#}
{%- if annot.imageRelativePath %}
 ![[{{annot.imageRelativePath}}]]
{%- endif %}

{#-**comment annotations**-#}
{%- if annot.comment %}
>[!annot] Comment
>{{annot.comment | nl2br}}
 {%- endif %}

{%- endfor %}
{%- endif -%}
{%- endpersist -%}

6 Likes

it needs highlighter plugin to work
and the output is this:

2 Likes

I just noticed that this template doesn’t grab the “item notes” from zotero (these are the notes that you write in the sidebar, not related to a specific highlights, see attached screenshot, on the right side). Do you know how to grab those as well?

Yeah, I don’t make standalone notes in Zotero, so I left that out. I see someone on Discord already gave you the answer. The only thing you need to do is remove {{formattedAnnotations}} from their solution. That’s what “brought everything”. So the solution is:

{%- if markdownNotes %}
{{markdownNotes}}
{%- endif -%}

This could be answered by using the built-in Data Explorer command that Zotero Integration provides, in combination with the templating guide for Zotero Integration.

1 Like