Zotero Integration – Import Templates?

Hi Kristi, I’m glad you find my template useful.

Let’s address those issues you’ve had:

Are you sure the item you’ve imported has an abstract in its abstract field in Zotero? For the other ones, have you made sure to actually expand the callout? They are collapsed by default, and you need to click to open them.

The part about other callouts is a bit unclear, because there are no callouts like “Important” and “Questions” in my template, those are just headings for each annotation category. Do note that you can and should change these categories to fit your needs.

Key takeaways and processing is stuff that you have to write yourself, in case you thought that it was an issue that these are empty. The code there are cursor placeholders you can jump to with a hotkey, if you set such a hotkey up for the Templater plugin (required for this to work).

Do you mean you have several PDFs under an item? I’m not sure I’ve added support for importing annotations from several PDFs. I can check when I’m at home with my desktop PC.

If there issue is the same as mine, it’s that I get no PDF annotations. I can get them just fine if I make the annotations a separate note (they’ll come under the note section). However, I’m not getting PDF annotations from the PDF itself.

I have reinstalled, rolled back, etc.

edit: I just tried with a new PDF and it brought everything in fine :man_shrugging:t2:

:loudspeaker: PSA to all nunjucks templaters, struggling or otherwise:

Zotero Integration’s Data Explorer (found in the command palette) now features a context menu with template helpers where you can right-click and copy the template code that captures a particular field:

3 Likes

Hi @galachus! Re: the above :point_up:
This is maybe not as relevant to you now, since I assume you’ve already set List Callouts up.
But anyway, I thought it would be useful for you and others to know that the List Callouts plugin just got a much-needed search box for icons:

:tada:

2 Likes

I know it has been a while since you posted these, but wanted to say thanks so much for being so generous with your work and time/responses: I’m pretty new to Obsidian, but your template and ideas have given me a very solid foundation for my workflow (as an academic reading lots of papers!).

cheers.

4 Likes

Thanks for the feedback, it means a lot to me! :heart:

I haven’t posted about it yet, but I have an updated version of my template with many improvements over on GitHub that you might be interested in:

I will go more into details about the changes at some point. The basics are still the same, but there are many QOL improvements, new edge cases considered, and other little innovations.

2 Likes

awesome, thanks - will check it out! :smiley:

1 Like

Hi @Feralflora,

I’ve been using your (new) template, and in my beginners - and complete coding/scripting neophyte - mind, had a couple of queries.

First - when importing from Zotero, I’ve noted that any tags written in zotero that have a space or comma delimiter get imported as two separate tags (e.g. ‘cardiovascular disease’ becomes ‘cardiovascular’ and ‘disease’, or ‘contraception, adolescent’ becomes ‘contraception’ and 'adolescent). I’ve figured out that I need to script something that says 'hey, take that ‘space’ or ‘,’ and deal with it, but I can’t quite figure out precisely where my script should go, and I can’t quite get it right.

Also - and this is more just to confirm something for myself - running your script as it is in github gets me a section that looks like this in my note:

I assume that this is because this section of your template is dependent on other templates/snippets in your vault? (basically if i remove that bit it won’t break anything else? :smiley: )

Once again, thanks for your template and replies above - definitely helping me muddle my way through learning a bit more about all this.

Hi @DisorganisedAcademic! Glad to see people trying the latest template version.

Is this true for all tags in the literature note, or in a specific place? Like in the properties, metadata callout or by the annotations? It should be easy to fix, when I know where you have the issue. I hadn’t really considered this, because I don’t use tags with spaces.


Yes, this is referring to the following Templater template that triggers an import when you push a button in the note:

<%* app.plugins.getPlugin('obsidian-zotero-desktop-connector').runImport('Import name',tp.file.title); %>

If you have the Buttons plugin installed, the code you asked about will render as a button in the template. You can safely delete the button code :slight_smile:

However, if you would like to try it out, note that “Import name” should be replaced with the actual name of the import (configured in Zotero Integration’s settings) that you want to run.

You also need to set a Template hotkey for this template in Templater’s settings. This makes it available in the command palette, which is what the button is expecting.

Lastly, the path in the button should reflect the actual path to the template in your vault.

I’ve written a guide that covers this template as part of a reading workflow I created that automatically imports Zotero items and metadata into a Kanban board in Obsidian based on tags in Zotero:

(I should probably make a forum post about this :point_up:)

1 Like

Should have mentioned that!


This is an illustration of what I mean.

I did try to write some code to fix it, but I just KNOW I’m doing something very simple and very simply incorrect :smiley:

I’ve written a guide that covers this template as part of a reading workflow I created that automatically imports Zotero items and metadata into a Kanban board in Obsidian based on tags in Zotero:

Excellent! Off to read it with my morning coffee (organising my obsidian absolutely counts as ‘work’ on a friday morning). Thanks, yet again.

1 Like

No problem, I’m glad my contributions help!

I’m taking a shot at this right now, so you could try it out if you are still up in your timezone in a little bit.

Oh, for sure :wink: :coffee:

1 Like

Okay, so the Obsidian behavior here is a bit strange. In the source yaml code, the tags are on separate lines as expected:

tags:
 - 📓
 - another tag
 - test tag
 - to-sort
 - unread

But when rendered as properties, the tags are considered separate, as you reported:

image

Since tags with spaces are not supported, I would expect that Properties would throw an error in this case, but apparently not, it just splits it when rendered.

Anyway, I’ve pushed at fix to GitHub that solves this by replacing spaces in tags with a dash (-) like so:

tags:{% for t in tags %}
- {{t.tag | replace(" ", "-")}}{% endfor %}
2 Likes

Aha! Excellent, thank you so much. I am also pleased to note that I wasn’t too far off on my own attempt :thinking:

Thanks again :smiley:

You’re welcome!
In the future, you can reference the nunjucks templating docs here: Nunjucks
It’s a great resource.

1 Like

Cheers - not sure if this is the time to mention that I HAD been referencing the nunjucks docs, just apparently not closely enough :laughing: (and it is an excellent resource - entirely operator error!)

1 Like

Hello! Is neophyte template maker here. Is it possible to mix sequential and color groupings in a template?

My situation is this. I highlight to mark things in terms of importance. Yellow is least important, then blue, and then red is most important. For these, I appreciate having them in sequential order, as they appear in the pdf.

The odd one out is the green highlighter. This marks sources I would like to follow up on. Ideally, I could gather all these green highlights under one heading, and then I can transclude that heading to a separate note for when I go to my university’s library.

Has anyone else done this kind of mixed method note? Thanks for the help!

Hi everyone,
I have a potentially stupid question:
I have an import template that used to simply import my written notes from zotero into a given section of the created literature note. however, this has stoped functioning properly and only transfers some parts of what I have written. Any ideas why?

This is the relevant (I guess) part of the template:
"# Notes
{% persist “notes” %}{% if isFirstImport %}

{{markdownNotes}} {% endif %}
{% endpersist %}"

Cheers!

Hi!

The problem is likely that isFirstImport means that {{markdownNotes}} are only imported the first time you import the item, and then never again as you import.

If you remove this condition, the Zotero notes are imported each time you update. With the persist in place, new changes will be appended. Without it, the old notes are overwritten by the new ones.

Hi Feralflora,
Thanks for your quick reply. I tried your recommendation but it did not really change anything in terms of the results I get. I played around with the data explorer and have - if I understand this correctly - the impression that the problem might not lie with the import. Below, you see that only a very short part of my zotero-note (which continues considerably beyond the first heading) gets recognised by the data-explorer. any further ideas?
cheers!

image

Hey @mgmeyers, thanks for the template, i tried it out but every annotation, no matter the colour in zotero, show under the header „interesting but not relevant“. It seems that the colours are in a way grouped correctly: When i have 2 things marked green in zotero, it shows those 2 things under the same heading. But again, all headings have the same name “interesting but not relevant”. any idea whats going on?

The css snippet does not seem to change the colour of the callouts, so i assume, theres something wrong with the colours, so that the template doesnt recognize the different colours in zotero correctly?