Single query for both page properties and block properties

No. What gets returned is determined by what is defined in the :find clause.
So either change the ?b to ?x there, or change the variable naming in the rest of your query.

Yes and no :slight_smile:
I found an attribute that gets added for blocks that are page properties.
But blocks with page properties are still just that, blocks.
We can “force” Logseq to return the page, but then you get the page information and not the blocks on that page.

So I fiddled around with your request a little.
Here’s what I came up with:

#+BEGIN_QUERY
{:title [:h3 "Quotations"]
 :query [:find (pull ?b [*])
  :where
;get blocks of type quotations (where quotations is plain text)
   [?x :block/properties ?props]
   [(get ?props :type) ?type]
   [(= ?type "quotations")]
   [?x :block/page ?p]
;either...
   (or
;the block is a pre-block (page properties) and so the quotation is a block on the same page, excluding the properties block
     (and
       [?x :block/pre-block? true]
       [?b :block/page ?p]
       [(!= ?b ?x)]
     )
;or the block has the properties block as its parent.
     [?b :block/parent ?x]
   )
 ]
 :breadcrumb-show? false ;don't show the breadcrumb (?x in the case of it being the parent block)
}
#+END_QUERY

2 Likes