Dataview queries in my Daily Note template return files created and edited on that day. I occasionally update and enhance these queries, but obviously these changes are not applied to previous daily notes.
I’d like to have my Daily Note template instead transclude these queries from separate “sub-template” files. Then any updated queries would be applied in existing Daily Notes created with this template.
However, transcluded queries cannot access the frontmatter/metadata of the host (transcluding) file. Queries run in the context of the page where they are written — not the page that includes them.
Proposed solution
Add a way for Dataview to query frontmatter of a host file when transcluded.
e.g.: in addition to this.date-created allow host.date-created
(It’s easy to describe, but I have no idea how technically challenging this might be.)
Obsidian is developing a core plugin called Bases, which is similar to Dataview.
It is faster that Dataview in returning and refreshing data, and it can be embedded in multiple files from a single point. Users can create a Base that references any note it is embedded in, so changes made to the Base are reflected in every note that has the Base / view embedded. Still in beta testing, but it might be worth waiting for (or becoming a beta tester).
For Dataview, take a look at the link below – probably worth reading the whole thread before you try anything. I used a version of the linked code for some time but it was slow and buggy. I have now switched to Bases.