Hi! I’ve created a Book collection and, with Dataview, I’ve created also a table with a link to a folder containing one file for each author (where I can find all the book I have read or want to read belonging to this author). So I have a folder with the books and a folder with the authors. How can I create a table (or something similar, maybe a Kanban Board?) where I can see, for each author, the book in my folder. Hope to have explained clearly what I have in mind: sorry, English is not my mother-language as you can easily guess Thanks in advance for any help

  • dakerDraws@pawb.social
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    Just to make sure I understand, you want your Author notes to have a Dataview table containing all the books they’ve written?

    For each Book note, do you have a field (either in YAML or inline Dataview) pointing to the Author note? What I personally do is have an inline field that links to the Author note:

    Author:: [[Stephen King]]

    Then in the Author note I’ll have this:

    table without id link(file.link,title) AS Book, Year FROM "BOOK FOLDER" WHERE contains(Author, this.file.link)

    Replace BOOK FOLDER with wherever your books are. Then you can paste this into all your Author notes. Even better, make an Author template so you don’t have to type it each time you make an Author note.

    • ilbradipoOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Thanks a lot for your promt reply. Obviously I was not so clear in explaining what I’m looking for, sorry. I already have an “author folder” with the same output you indicate (one note for each author. I have also an “Author Gallery” with a list of all the authors with this dataview code: TABLE genre as Genere FROM "autori" SORT file.name I wish to have, instead of genre a list of all “my” books from this author. Could this be possible?

      • dakerDraws@pawb.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Do you want to do something like this?

        table without ID file.link AS "Author",
        filter(file.inlinks,(x)=>contains(x.Author,file.link) & contains(x.file.path,"Book Folder")) AS "Books"
        from "Author Folder"
        sort file.name
        

        The only thing you would need to change in this code is the Book Folder and Author Folder.

        But if you would like it to be a more visually appealing gallery, there may be some community plug ins you’ll have to try.

        • ilbradipoOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          Just a question: if a book have more than one author, how do you suggest to modify your code or the YAML in order to show the books?

        • ilbradipoOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          Thank a lot! Exactly what I’m looking for! Where can I learn about the “query language” you’ve used? Can you point me also to the plugins I can try? Thanks in advance!

  • Tenebris Nox@feddit.uk
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Following on from @dakerDraws@pawb.social, if you want the output to look like Kanban use the Minimal theme and put in the YAML at the top of the note (you can do this with other themes but would need a css snippet):

    ---
    cssClasses: cards
    ---
    

    One neat touch is if you put an image link as a field in your YAML, the card can show that, eg:

    Cover:: ![[lord-of-the-rings-cover.jpg]]
    

    Images can be attachments in your vault or external links to images online.

    • ilbradipoOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Thanks a lot! I’ll try this and I think It would be better (from a graphical point of view, at least)