Hi, I have a fairly simple dataview block that I would like to convert to an inline query.
The query looks like this:
list where type = "monthly notes" sort file.ctime desc limit 1
Visually it looks like this:
The reason why is that I would like to have an inline link so that I could put that inline link into a header or paragraph instead of having it into a list on its own.
So I could have a link saying: “Current monthly notes” linking to that file. Instead of having a header and a single list item like on the screenshot.
So far it seems that inline DQL is mostly to display meta properties but not to do actual queries. I thought I might be able to do it with inline dataviewjs but I can’t seem to figure it out so I thought I’d ask here.
There are two different approaches to this, both using dataviewjs to some extent. That is either to use it with a normal DQL query and extracting the result from there, or rebuilding the entire query into a pure dataviewjs query. In both cases, you’d most likely want to build the entire paragraph from within the query.
Or you also use an inline dataviewjs query, which is a little more icky with regards to getting the correct amount of semicolons and spaces, and what not.
Wow! I can’t believe how extensive dataviewjs is. This opens so many possibilities. I wasn’t aware of those different syntaxes to handle queries. Obsidian is a developer’s dream come true.