Using the dataview and templator plugins, I’m trying to display the number of notes inside the current folder.
Essentially, I have a folder of lecture notes for each class and I want a line at the top of each note that says “Lecture 5 of x” with x being the number of notes in the current folder.
Things I have tried
I have a template setup which works with the this dvjs query below:
`$=dv.pages('"Lectures/myclass"').length`
The problem being that the ‘myclass’ part needs to be a dv function to get the path of the current file’s parent folder since it is a template. I can’t seem to get the syntax correct in order to pass this function to get the current folder path to the pages function.
I’ve tried differing variations of this but can’t seem to get it to work:
But I’m not sure this is the optimal way to get that number. It might be better to look into the various cache structures of the apps metadata.
Update: Backticks within an inline query like this don’t work, so this could have been used within a full dataviewjs query. Even though I still think the cache structure would be better suited for this purpose.
(With apologies to the OP for this hijack, I want to thank you for the help with the game-tracking code. I have been offline for some time so couldn’t reply sooner, and I can’t reply on that thread as it is now locked.)