Dataview implicit field for including page

How to use an implicit field for including page

Short version

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): this.parent.file.name -ish…

Longer version

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:

“Included page”

TASK FROM ""
WHERE contains(text, this.file.name)

Then several parent pages (“Foo”, “Bar”) that include it using:

![[Included page]]

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.

we don’t take FR for dateview. This forum FR section is for obsidian core only

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.