I’ve spent hours on this forum but wasn’t able to find a solution.
What I’m trying to do
When I import the zotero annotations, the section is empty. I’ve been using this template without issue for more than 2 years now and suddenly I’m having this issue. I’m using a modified version of @Feralflora ‘s template (hats off to you !!)
I’ve tested on the previously created notes but I noticed that newly added annotations weren’t being imported into the obsidian note.
I’m not familiar with the templater language so I’d really appreciate you guys’ help
This is what I get after importing the annotation.
The annotation section is empty.
This is the template
# Zotero Annotation
{% macro heading(color) -%}
{%- if color == "#2ea8e5" -%}
💡 Result / Key Conclusion
{%- endif -%}
{%- if color == "#ff6666" -%}
⏰ Questions / Follow Up
{%- endif -%}
{%- if color == "#ffd400" -%}
⭐ Interesting Point
{%- endif -%}
{%- if color == "#e56eee" -%}
🧩 Method
{%- endif -%}
{%- if color == "#a28ae5" -%}
🦄 Research Question / Hypothesis
{%- endif -%}
{%- if color == "#f19837" -%}
🥕 Contribution{%- endif -%}
{%- if color == "#aaaaaa" -%}
⚙️ Data{%- endif -%}
{%- if color == "#5fb236" -%}
📣 Literature to Read / Look Up
{%- endif -%}
{%- endmacro -%}
{% macro calloutCharacter(color) -%}
{%- if color == "#2ea8e5" -%}${%- endif -%}
{%- if color == "#ff6666" -%}@{%- endif -%}
{%- if color == "#ffd400" -%}&{%- endif -%}
{%- if color == "#e56eee" -%}~{%- endif -%}
{%- if color == "#a28ae5" -%}!{%- endif -%}
{%- if color == "#f19837" -%}€{%- endif -%}
{%- if color == "#aaaaaa" -%}?{%- endif -%}
{%- if color == "#5fb236" -%}%{%- 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 %}
> [!cite{% if annotation.color %}|{{annotation.color}}{% endif %}]+ Image [(p. {{annotation.pageLabel}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}})
> ![[{{annotation.imageRelativePath}}]]{% if annotation.hashTags %}
> {{annotation.hashTags}}{% endif %}{%- if (annotation.comment or []).indexOf("todo ") !== -1 %}
> - [ ] #followup {{annotation.comment | replace("todo ", "")}}{% else %}
> {{annotation.comment}}{%- endif -%}
{% elif (annotation.comment or []).indexOf("todo ") !== -1 %}
- [ ] #followup {{annotation.comment | replace("todo ", "")}}:{% if not annotation.annotatedText %} [(p. {{annotation.pageLabel}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}}){% else %}
- {{calloutCharacter(annotation.color)}} {{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 -%}
{% elif annotation.comment %}
- {{calloutCharacter(annotation.color)}} {{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}}{% else %}
- {{annotation.comment}} {% if not annotation.annotatedText %} [(p. {{annotation.pageLabel}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}}){% endif -%}{% endif %}
{%- elif annotation.annotatedText %}
- {{calloutCharacter(annotation.color)}} {{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 %}```