Zotero Integration – Import Templates?

What kind of template do you mean?

Hmm, I would’t really know how to implement that. It’s no problem to color chapter titles yellow, but it would then group all the chapter titles together.

You would need remove line 149 {% for color, colorCategorie in zoteroColors %} and the corresponding {% endfor -%} on line 165, from the template which is responsible for the grouping of the highlights.

Lines 11 to 19 are responsible for setting what the colors “mean”

Lines 149-165 are the loop that write out the annotations

The best way would be to just experiment. I must have imported zotero item a hundred times creating my template…

2 Likes

You can preview the import as you make changes to the template in the Data explorer.

However, I must admit that I also just delete and reimport the same item again and again…

1 Like

Something like this. I’m pretty new here but you’ve never heard of an obsidian vault template?

https://www.reddit.com/r/ObsidianMD/comments/wxrtup/how_can_i_check_out_some_really_cool_obsidian/?utm_source=share&utm_medium=android_app&utm_name=androidcss&utm_term=1&utm_content=share_button

https://www.reddit.com/r/ObsidianMD/comments/zophon/a_highly_opinionated_fully_functioning_obsidian/?utm_source=share&utm_medium=android_app&utm_name=androidcss&utm_term=1&utm_content=share_button

Hi everyone,

All of these template examples are great :). I’m currently working on my own version, although not as advanced.

I am currently stuck on one thing. I use Zotero’s “Related” tab to link papers together and have found a way to import those linked papers’ citekeys. This gives me a “Research Rabbit” style graph with automatic wiki-linking. My issue is that I’m not sure how to sort this list during import.

I’m trying to sort it by newest to older (by publication date) so that the most recent papers are listed first. So far all I have is:

> [!example]- Related Papers
> {% set relations = relations | sort(attribute"date”, reverse=true) %}{% for relate in relations %}
> - [[@{{relate.citekey}}]]{% endfor %}

This lists the citekeys of the related documents but does not sort it. I don’t come from a coding background so any help would be appreciated.

1 Like

I was asking for clarification because you seemed lost. This thread is for templates for a particular plugin, namely the Zotero Integration template.

You’ll want to go to this thread for example vaults, and check the links therein: List or repository of downloadable vaults?

Here’s a short video explaining the Zotero Integration workflow: Zotero Obsidian Integration - YouTube

Figured out a solution to my problem. Leaving my snippet for anyone who also uses linked papers in Zotero.

{%- macro DateCompare(a, b) -%}
{%- set dateA = a.date | moment('YYYY-MM-DD') -%}
{%-set dateB = b.date | moment('YYYY-MM-DD') -%}
{%- if dateA.isBefore(dateB) -%}
-1
{%- elif dateA.isAfter(dateB) -%}
1
{%- else -%}
0
{%- endif -%}
{%- endmacro -%}
{%- set relations_sorted = relations | sort(attribute='date', reverse=true, comparator=DateCompare) -%}
{% for relation in relations_sorted %}
- [[@{{ relation.citekey }}]]{% endfor %}

This code will list the citekeys for all linked papers in the “Related” tab in reverse chronological order.

7 Likes

“There was quite a bit of setting up to do in the List Callout plugin settings, which I am happy to post my settings if people are interested.”

Great template, compliments. Do you mind sharing the List Callout plugin settings?

2 Likes

I get this as well! Do someone has a solution for this?

Hi Apfelstrudelig,

I love your template! The only problem I have is that my ‘highlight’ boxes appear grey in my case. Any idea how to fix this?

@EGARAY I am interested to see your List Callout plugin settings.

Can you provide me the meaning of

Zotero Strings

  1. “sm”: “sm” : Summary
  2. “df”: “&df” : Definitions
  3. “pr”: “!pr” : Purpose
  4. “am”: “!am” : Aim
  5. “hp”: “!hp” : Hypothesis
  6. “cg”: “!cg” :
  7. “cb”: “!cb” :
  8. “sb”: “$sb” :
  9. “pt”: “$pt” :
  10. “in”: “$in” :
  11. “ms”: “$ms” :
  12. “sa”: “$sa”,
  13. “ot”: “$ot”,
  14. “rs”: “@rs” : Results
  15. “lc”: “~lc”,
  16. “la”: “~la”,
  17. “ld”: “~ld”,
  18. “pc”: “~pc” : ?Connection
  19. “pa”: “~pa” : ?Agree
  20. “pd”: “~pd” : ?Purple Disagree
  21. “fi”: “;fi” : Future Implications
  22. “ri”: “;ri” : Resurch Ideas
  23. “mt”: “?mt” : Misc Thoughts
  24. “fu”: “?fu” : Info to Follow Up
  25. “rf”: "%rf : Reference to Follow

Apologies if question outside the scope of this thread. But is there a way to extract both annotations and notes into one obsidian note.

Maybe there is an issue with my workflow, but I find it counter intuitive having to extract pdf annotations and then separately any notes.

  1. this I way I might actually forget to extract my Zotero notes (if any), and extract only PDF annotations.

Is there a template that will extract all with 1 click? Thanks.

If you currently have a template that imports annotations, see this comment on what to add to import notes as well (the code block): Zotero Integration – Import Templates? - #87 by Feralflora

1 Like

Thanks for that. Where can I find the most up to date version of your template, as I find it a bit hard to orientate within and across the long threads full of code :slight_smile: . It would be fantastic if the Zotero Integration Plugin had a template gallery (similar to themes) where you could easily pick a template that works for you. I understand it’s asking for impossible but it would really be fantastic. Especially for people like me who find it hard to deal with code.

1 Like

Here you go: Zotero Integration – Import Templates? - #105 by Feralflora

Btw, a template gallery sounds like a great idea. You should make a feature request on Github.

1 Like

Hey @Feralflora thanks for sharing your template. I have just started using zotero with obsidian and your template is very helpful to convert my zotero notes.
I see from the template that you are using templater (?) and dataview.
Can you tell me a bit more about how these are useful in your workflow?

2 Likes

How did you able to display embedded images in table query?? Mine just showing image path

@Qwxlea Thanks for the great template, however block quotes do not appear to be rendering correctly.

image

Also images don’t appear to save correctly and thus are not rendered in the output.

image

Finally, how do you get the zotero emojis

Nice template, does this have consistent block ids, or not?