Query table view - display the page title (when block result is a page-property block)?

follow-up to this discord link

in some queries, the page-title result is more relevant than the block-content.

when we {{query (property x)}} we also see results from (page-property x) which is great, but maybe, when the block is a page-property block (first block a page), the ‘block’ content should ideally be replaced by the ‘page title’ in the Table View results : (maybe with the page icon [P] to make it clear it’s not a block content ?

  • the properties from the page-property block will get their own column in the table anyway, so having them displayed in the ‘block’ cell is redundant and makes the table very busy
  • as shown is the example above, if a page has a similar page-property and block-property in its contents, it would be displayed twice (once with the link to the page, and another time with the link to the relevant block)

alternativeley, in previous versions, I remember there was an option to display the page-name/page-title column in the Table view options ? it seemed to have disappeared after 0.5.8

This would make the ux more consistent between table view and list view :

images stolen from this post by @ThatGuy

I’ve seen a number of posts where people are confused with the different results when querying page-properties rather than block-properties.
for instance
@SoKirill - 2021-11-10
@Ivo - 2021-08-31
@That Cute Guy - 2021-07-20

in the current state, it feels like the user has to chose between using block-properties OR page-propeties, since mixing both will result in the funky table views full of tags::.... examples above.

I think the paradigm that a page is just a block with special properties should apply : a user should NOT have to chose between page-properties or block-properties, query a property should return BOTH blocks and pages in a useful presentation. (I assume page-property is just a subset of property, as it seems to be how logseq is operating)

I’m very open to hear suggestions and feedbacks to make this FR more relevant and useful for all possible use-cases.

Voted … I run into this a lot. Specially with simple queries you want to display nicely.
Page (preferably with link to the page containing the block) should always be visible.

I found a workaround for this - you can add a “title” property to the top of the page and set it to <% current page %>. Once you do this, title shows up as a field to select in the query settings.

would love for this to happen!

Any update on this one?

Basically query {{query (property FOO)}} returns blocks, but how can I display page title (or something from parent block) in table results?

Does NOT work, but maybe step forward:

{
 :query [
         :find [pull ?b [*]] [pull ?p [*]]
         :where 
         [has-property ?b :property_name_you_care_about]
         [?b :block/page ?p]
]
}

Tried this:

#+BEGIN_QUERY
{
:title "Trying to get page names"
 :query [
       :find ( pull ?p [*] )
       :where 
       [?p :block/name ?name]
]
}
#+END_QUERY

but still, instead of making weird tricks it should be IMHO directly supported in simple query syntax / UI (like turning off and on columns to display, “page-name”/“page-title” could be another introduced column that by default is turned-off, and one can just click in table settings to enable it…) … somehow.

This has been implemented with Enhance: Add page column for query tables with block results by logseq-cldwalker · Pull Request #8869 · logseq/logseq · GitHub and is going out for next release

1 Like

it’s a great improvement, thank you !

1 Like