I have a folder structure like this: journal/YYYY/weekly notes
What I’m trying to do
I’m making a year template that queries all the weekly notes for that year (so they are in that years folder). Issue is, I don’t know how to make the FROM query to accept a dynamic date in the path.
Things I have tried
Using:
Table title, score
From ...
WHERE score != null
I have tried with these FROMs, but all of them result in some error. It seems like I can only use the static year number.
From “journal/” AND (date.getYear())
From “journal/{{date:YYYY}}”
From “journal/” + date.getYear()
From “journal/” + {{date:YYYY}}
Remember when viewing the template the queries will not work, you need to create the note based on the template before you can check the query.
Based on this it seems like the second variant should work, that is From "journal/{{date:YYYY}}".
If you want a truly dynamic query, but depending on a template and which gets updated when the year switches, you’ll need to write your query using a WHERE clause related to file.folder.
You can use templater commands in the template used to create the note with the query. And I reckon the same should be doable with the core template plugin.
When the note is instantiated you can’t use the template commands though.