obsidian-dataview
obsidian-dataview copied to clipboard
relative path support
Currently it's a pain to write a generic queryfor "everything in current folder", as you can't do LIST FROM this.file.folder
I think something like LIST FROM "."
or LIST FROM "./subfolder"
would be nice
I've actually added relative path resolution for some DataviewJS work, so I can probably extend it to queries at this point.
This would be very useful - was it implemented? I don't seem to be able to get it working.
Also running into this issue, support for relative paths would be great.
Any update on this? This feature would allow users to submodule obsidian repos. Right now dataview will only render in the primary repo if the submodule uses absolute path, which breaks the submodule repo
I know the following doesn't work:
LIST FROM this.file.folder
BUT, is there an equivalent using DataviewJS?
dv.current().file.folder
. In DQL, you can use a where condition where file.path = this.file.path
.
This dataviewjs worked!
dv.list(dv.pages('"' + dv.current().file.folder + '"').file.path)
But, I couldn't get the DQL to work (it's always empty)
task from "journals/2022"
WHERE file.path = this.file.path
That's weird. Are you sure the path is correct and doesn't have typos? What's the output of dv.current().file.folder
?
Hello,
You can do that with help of the folder
, not the path
implicit field:
LIST
WHERE file.folder = this.file.folder
Path contains the file name, folder does not.
Thank you. I see it interprets the string, allow me to extend your example for those wanting to point to a relative dir. E.g. in the current dir we have a subfolder recipes
, then we can use:
WHERE file.folder = this.file.folder + "/recipes"
Hello,
You can do that with help of the
folder
, not thepath
implicit field:LIST WHERE file.folder = this.file.folder
Path contains the file name, folder does not.
any news on this?
any news on this?
This works for me currently.
table without id
file.name as "Revision Date",
author,
comment
from #revision
where file.folder = this.file.folder + "/revisions"
I would like to add my vote for this feature request.