Zotero-Obsidian Integration Template Help

What I’m trying to do

So I have been working on this zotero integration template, and I have been piece together bits of script from the community. I want my template to have a section for notes (the review section with the contribution) that does not update when I rerun the template but I want the annotations section to update if I need new to place new annotations. The template works except for that one portion I am struggling with.

---

category: literaturenote
tags: {% if allTags %}{{allTags}}{% endif %}
status: unread
citekey: {{citekey}}

---

> [!Title] 
# **{{title}}**
  

> [!Cite]
> {{bibliography}}
  

>[!Synth]
{% persist "notes" -%} {%- if isFirstImport %} 

>**Contribution**::

### Key Questions

- 1:

- 2:

- 3:

### Review Questions

- **Is the problem important?** 

- **To what extend does the paper solve the problem it describes?**

- **What is the intellectual nugget?**

- **What is the main contribution / conclusion?**

- **Does the content support the conclusion?**


{% endif %}
{% endpersist %}
  
>[!Properties]

{% for type, creators in creators | groupby("creatorType") -%}

{%- for creator in creators -%}

> **{{"First" if loop.first}}{{type | capitalize}}**

{%- if creator.name %} {{creator.name}}  

{%- else %} {{creator.lastName}}, {{creator.firstName}}  

{%- endif %}  

{% endfor %}~

{%- endfor %}    

> **Title** {{title}}  

> **Year** {{date | format("YYYY")}}  

> **Citekey** {{citekey}} {%- if itemType %}  

> **itemType** {{itemType}}{%- endif %}{%- if itemType == "journalArticle" %}  

> **Journal** *{{publicationTitle}}* {%- endif %}{%- if volume %}  

> **Volume** {{volume}} {%- endif %}{%- if issue %}  

> **Issue** {{issue}} {%- endif %}{%- if itemType == "bookSection" %}  

> **Book** {{publicationTitle}} {%- endif %}{%- if publisher %}  

> **Publisher** {{publisher}} {%- endif %}{%- if place %}  

> **Location** {{place}} {%- endif %}{%- if pages %}  

> **Pages** {{pages}} {%- endif %}{%- if DOI %}  

> **DOI** {{DOI}} {%- endif %}{%- if ISBN %}  

> **ISBN** {{ISBN}} {%- endif %}    

  

> [!LINK]

>  {{pdfZoteroLink}}

  

> [!Abstract]

> {%- if abstractNote %}

> {{abstractNote}}

> {%- endif -%}.


> [!Keywords]

> {% if allTags %}{% for tag in allTags.split(",") %}[[{{tag.trim()}}]]{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}

# Notes
> {%- if markdownNotes %}
>{{markdownNotes}}{%- endif -%}
>
# Annotations

{% macro calloutHeader(color) -%}

{%- if color == "#ffd400" -%}
**Important Point**
{%- endif -%}

{%- if color == "#ff6666" -%}
**Issue, Flaw, non-supportive argument, or criticism** 
{%- endif -%}

{%- if color == "#5fb236" -%}
**Supporting argument/example**
{%- endif -%}

{%- if color == "#2ea8e5" -%}
**Hypothesis/objective statement**
{%- endif -%}

{%- if color == "#a28ae5" -%}
**Related Reference**
{%- endif -%}

{%- if color == "#f19837" -%}
**Instrumentation or methodological points of interest**
{%- endif -%}

{%- if color == "#e56eee" -%}
**Future work/directions**
{%- endif -%}

{%- endmacro -%}


{% persist "annotations" %}
{% set annotations = annotations | filterby("date", "dateafter", lastImportDate) -%}
{% if annotations.length > 0 %}
#### Imported on {{importDate | format("YYYY-MM-DD h:mm a")}}

  
{%- for annotation in annotations %}
<div class="note-box" style="border: 1px solid; padding: 10px; margin-bottom: 10px; position: relative; overflow: hidden;">

    <div style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: {{annotation.color}}; opacity: 0.1; pointer-events: none; z-index: -1;"></div>

  

    <div class="note-content" style="position: relative; z-index: 1;">

        <h3>{{calloutHeader(annotation.color)}}</h3>

  

        {%- if annotation.imageRelativePath %}

        > ![[{{annotation.imageRelativePath}}]]

        {%- endif %}

  

        {%- if annotation.annotatedText %}

        <p>{{annotation.annotatedText}} (p. <a href="zotero://open-pdf/library/items/{{annotation.zoteroItemKey}}?page={{annotation.pageLabel}}">{{annotation.pageLabel}}</a>)</p>{%- endif %}

  

        {%- if annotation.comment %}

        <p><strong>Comment(s):</strong> {{annotation.comment | nl2br}}</p>{%- endif %}  

    </div>

</div>

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

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.