-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 Panel Design / API (Latest Posts, Calendar, etc) #2662
Comments
Here's the basic design for a v1 — a "minimal" solution: I reduced the set to:
Rationale:
Note: I didn't use a slider for "Number of Items" as I'm considering adding "All" (but, performance?). If we don't want to add All but we want a limit, then we should user the slider component. In the mockup I also avoided getting in too many details about the content of each of these lists, so if we agree the three dimensions above are a good v1, we should review its content. Order By:
Category:
Number of items:
I haven't included an idea for a Query Panel v2 yet as time wise this seems more relevant, but of course the key concept here is that if we introduce a "universal" Query Panel that any block can use, we can extend it later with 100% compatibility and instant upgrade for any plugin that reuses it. |
I really like this. I can see it helping a lot of people get a head start into blocks - which is a huge benefit. My concern is time and getting this done, that said I think it's a great project for someone to take ownership of. I would love to include this as soon as possible if someone is up for implementing it. Any takers? |
For “Number of Items”, what about a |
As I mentioned above:
So yes, if we don't want an "All" we can use the existing slider component: As for arbitrary – they aren't, if we want to go in that direction I can explain. ;) |
Right, “all” is not appropriate for performance reasons. Slider with number input I think is right. |
Query panel was merged in #3198 implementing the proposed design for the latest posts block. |
Question: is the implementation of |
Hi @folletto, when implementing the QueryPanel I tried to make it reusable and abstract enough so that other blocks can use it. It is an independent component, for each input you need to pass the current value that is selected and an onChange handler. The fields shown are also configurable e.g: some can be hidden. |
Awesome! Thank you! <3 |
In #1594 we explored the idea of having a "universal" Query Panel that any block and plugin could reuse. The general idea is to provide an easy way to execute queries (WP Query) so any block that lists posts, pages, or other content type could use.
Benefits:
Cons:
Notably this means having a v1 added to Gutenberg soon, so blocks and plugin developers could use it, and with following iterations we can rely on the common API to upgrade it.
The text was updated successfully, but these errors were encountered: