Advanced queries: howto avoid the default display?

Hi,
I’m trying to figure out how “advanced queries” in LogSeq work and I want to display a single result: Here is my query:
#+BEGIN_QUERY
{:query [:find [(count ?name)]
:where
[?p :page/name ?name]]
:view (fn [result] result)
:collapsed? false}
#+END_QUERY
And I want to display a simple text like (I have 135 pages in my current database):
“Pages: 135”
I can see the result “135” however but it is displayed in a special formatting which I don’t want.
Hence my question: is there anyway to change how a query result is rendered?
Thanks

1 Like

You mean you’d like to have the result inline and not within the bulky collapsable result structure? I’d like to be able to do that too sometimes. There’s no way I’m aware of yet, outside of perhaps some severe CSS hackery, but I may just not know about it. But here’s a screenshot to help clarify what I think you mean (correct me if I’m wrong):

CleanShot 2022-10-13 at 09.49.29@2x

1 Like

Hi Peeja, thanks for responding. Your understanding is correct, this is exactly what I meant. I want to display only a line with some text and the result of the query and nothing more.
Like you I don’t know if it is doable as is in a LogSeq page however it’s doable inside a plugin. “Log-stats” -which you can find in the market place- is doing just this for a lot of metrics (number of pages, blocks, etc.). I just want to do something like this but for my own set of metrics. But so far I’m not at the point where I can understand everything this plugin is doing… but this is on my todo for the coming days!
Best,

1 Like