Is it possible to prevent certain parts of a Zotero Integration template from being updated on a re-import?

What I’m trying to do

I am using the Zotero Integration plugin to import articles into Obsidian. This pulls out annotations from the article, and I also have a section where I write a summary.
My issue is that if I re-import the article, the summary I’ve written is gone.
Is there a way to protect certain parts of my template from updating when I re-import an article?

Things I have tried

I have tried this solution with the Templater plugin but it did not work.


# Quick Summary
Write anything you want here…

# Literature Note
These lines are also safe from overwriting.


<!-- --------------- Zotero Start --------------- -->
<%*
/* Or Liquid etc. The key is that your template 
   does NOT include Quick Summary & Literature Note headings at all. */
%>
# Thoughts/Connections
{% for note in notes -%}
…
{% endfor -%}

# Markup While Reading
{% for annotation in annotations -%}
…
{% endfor -%}
<!-- --------------- Zotero End --------------- -->

As long you’re using a template to regenerate the note itself all your changes will be lost. So you’ll need to store your changes outside of what the template regenerates. One way to do such a thing would be to let the template embed some notes embedding your extra details.

In other words, you should let the template have some embeds of a summary (and possibly comments) related to the zotero thingy you’re importing.

Depends how the plugin is written.
Check the settings: is there an append functionality?

If you suspect it’s not doing what it ought to do, you can do various things:

  • temporarily rename the previously imported note
  • change the import folder temporarily
  • copy your summary to the pdf as an annotation in sticy note, so the importer will bring that in

I’m not sure how templating will help you, unless:

  • you create a new template for Zot Int (not Templater plugin) where you add your previously written material as hardcoded stuff

In a Zotero Integration template, the magic incantation is to put

{% persist "something" %}

before the stretch of stuff you want to keep, and

{% endpersist %}

at the end of the stretch.

Some comments:

  • The "something" in quotes is an arbitrary name you can give the persist-block. I don’t know if it’s obligatory, but including it can’t hurt. If you have more than one persist-block in your template, you should probably give them different names.
  • There’s some finicky conditions about where line-breaks can go before or after the incantations, which I never figured out. I got my template working through trial and error. (Apparently putting hyphens before or after the percent sign will do something different with line breaks, but from your example, it looks like you’re already ahead of me on understanding that.)
  • If you want your template to grab some info from Zotero the very first time you import the note and to leave it alone forever afterwards, you can put a {% if isFirstImport %} immediately after the initial {%persist ...} and an {% endif %} immediately before the {% endpersist %}.