Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when running Templater's trigger option in Booksidian. #16

Open
bilgenotlar opened this issue Sep 25, 2022 · 1 comment
Open

Comments

@bilgenotlar
Copy link

Hello. First of all, thank you for this great plugin. The plugin works just fine. However, I would like to share with you a problem I encountered. I am using "templater" and "dataview" plugin in "content of the book note" section. Here is the content I entered in this section:

{{title}}
yazar:: #<% tp.frontmatter.author %>
kategori:: #<% tp.frontmatter.shelves %>

table without id ("![|250](" + cover +")") as Cover, yazar as Yazar, rating as Rating_My, avgRating as Rating_G, kategori as Kategori 
from "<% tp.file.folder(true) %>/<% tp.file.title %>"
where cover != null
sort rating desc

My goal is to show in a table information such as the cover illustration of the relevant book, my own rating, the rating and category of the Goodreads community.
The Templater plugin codes I use here work exactly as I want. However, an interesting problem arises if I run the "trigger" feature in the Templater plugin settings. The book information on my list is getting mixed up.
For example, let's say I'm pulling information from a science fiction shelf. I have books A, B, C, D... on my Sci-Fi Shelf. I'm importing into my obsidian vault with the Booksidian plugin. If the Templater trigger is not turned on, I go into each book file on my shelf and run the templater codes manually. No problem.
But if you have 50 books on your shelf, you have to repeat this 50 times.
In this case, the Templater trigger feature is a great solution. However, as I mentioned above, the information is mixed. For example, A book cover picture B is B cover C, D or someone else.
I'm not a professional expert, but I think things get messy when fetching cover images from the internet. It would be great if a method could be found to fix this problem.
I'm very new to Github. I hope I wrote it in the right place.

@zacharyw
Copy link
Collaborator

zacharyw commented Jul 17, 2023

@bilgenotlar I'm not sure if this is an issue with templater or this plugin or some weird interaction. But, I was able to work around your issue by using the Booksidian template variables instead of using templater to go through the front matter.

For example I changed your "content of the book note" setting to this:

{{title}}
yazar:: #{{author}}
kategori:: #{{shelves}}

```dataview
table without id ("![|250](" + cover +")") as Cover, yazar as Yazar, rating as Rating_My, avgRating as Rating_G, kategori as Kategori 
from "<% tp.file.folder(true) %>/{{title}}"
where cover != null
sort rating desc
```

And it seems to work correctly. I'm using {{title}} here instead of tp.file.title, but you should put in whatever you're using to generate the filenames in Booksidian.

@husjon husjon assigned husjon and unassigned husjon Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants