Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Block - Separate it from the Query Loop block #29119

Open
rmorse opened this issue Feb 18, 2021 · 2 comments
Open

Query Block - Separate it from the Query Loop block #29119

rmorse opened this issue Feb 18, 2021 · 2 comments
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Enhancement A suggestion for improvement.

Comments

@rmorse
Copy link
Contributor

rmorse commented Feb 18, 2021

What problem does this address?

I see a lot of great work and thought being put into the new query block. When I first heard of the query block, I thought great - a standardised implementation of queries in the block editor.

However, I don't feel this has been completely "standardised" - in that, as a developer, I don't actually have access to the query - I can't use the query builder UI, and supply that query to anything specifically - it must be used with Query Loop block...

Currently a query block is - a Query Block with Query Loop Block, with child blocks for the post templates.

Now the query block is being brought out of FSE (which is aimed more at theme devs I guess) we could be thinking about it as a tool for block developers.

What is your proposed solution?

What if... we had a "Just Query block" that was ready to drop child blocks into? Or we enable InnerBlocks and allow the removal of the Query Loop block in the current Query block.

So we can supply queries via the new UI and pass that down through context, but then we would let devs completely decide what to do with them.

There are tons of uses cases where you would want to allow a block to have access to the actual query.

What about having a query block, and dropping in a carousel block? There could be a million (*ahem) uses - anything that traditionally uses "The Loop" could apply.

It actually makes life a lot easier for devs who want to do anything with queries (that are user configurable) - because re-inventing the wheel is pointless (and painful).

Thoughts / suggestions?

@rmorse rmorse changed the title Query Block - Seperate it from the Query Loop block Query Block - Separate it from the Query Loop block Feb 18, 2021
@skorasaurus skorasaurus added the [Block] Query Loop Affects the Query Loop Block label Feb 18, 2021
@gziolo
Copy link
Member

gziolo commented Feb 19, 2021

I think what @ntsekouras explores in #28891 could make it possible to add very interesting customizations to the Query block.

@ntsekouras
Copy link
Contributor

Thanks for creating this issue @rmorse! As we have already discussed, this is a very interesting idea and something worth exploring!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants