If a dataview uses
this.file.name, how can I get that to work when that dataview is included with
![] in another page and make the variable be the one of the including page?
I need a (pseudo code):
I’d like to run a
dataview query in a page that is included in many other pages, and have that included page know the implicit fields of the page that is including it.
For example… I have a page which I’d like to include in multiple pages that has this:
TASK FROM "" WHERE contains(text, this.file.name)
Then several parent pages (“Foo”, “Bar”) that include it using:
Then anywhere in my vault I can mark a task with [[Foo]] anywhere, and the page [[Foo]] will have a list of all the tasks with its name in it.
Crucially, that “Included page” may change a lot. I may add new features and sections, and all pages that include it should get that latest one.
The only problem with all the above is
this.file.name does not work once embedded in a page. I see Dataview: No results to show for task query.