I have files about books with tags #Book and a tag the identifies the book in question. Lets call this the #TitleTag
I also have a file for each chapter of the book, containing the tag #Chapter and the #TitleTag from the parent book.
What I want to do is create a Base template I can insert into the book file, to list its chapters.
Things I have tried
Are too numerous to list - almost all refused to save without giving any error message.
I think I need to inherit the tags from the parent book, remove the #Book tag, and filter using the remaining #TitleTag. I don’t know how to do this.
I would be happy to move the #TitleTag in the book and chapter that identify the book, into a new properties field (by Python program!). Using this approach I have managed to get the display I want using hard coded values. Still can’t inherit using this.TitleTag though.
You can add a base to your book notes and then filter the base by a specific tag. This gives you a list of all files with that tag. As I understand it, the #titletag is unique for each book, so the challenge is to somehow retrieve this tag from the book note in which the base is embedded. This is possible with this.. You can then filter files which partially have the same tag as the book notes.
I think it would make sense to move the #titletag into a book_id property field. If you plan to use bases more frequently, storing this information in the frontmatter is preferable, in my opinion.
I agree. I will be writing a program to alter the files (I have 400+ books), and then I am left with the problem of how to inherit this.book_id into the base template.
Everything I have tried so far has either not selected any files, or it is rejected as invalid syntax.
If you add this as a filter in your base an then embedded your base in a booknote, it will show all files which have the same book_id as the book note: