-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Suite of Post Blocks #15623
Comments
Just for clarification, that screenshot is of three Post blocks using the Columns block? Or a block that adds posts based on a templateOption selection (using this Post block)? Just wrapping my head around it :) |
This one I think. The parent block being something like a "repeater" block. Edit: The block can probably support both. |
Yes, I figure we'd end up with a "Loop" container that defines and handles the query options. Inside, it would use a Post block with a specific template/layout. That's why I think we can converge on the problem by enhancing the Latest Posts block and implementing these more granular sets of post child blocks. |
So is the idea that this is a single block for now then later it might be combined with a post list block to provide the "item" for the list? It could also function as a stand alone block foe rendering a single post. Practically if used within post listing, how would this block receive the post id context? Would it require the parent list block to dispatch to update the attrs of the child post blocks? It would be great to see this come to life. Do we see the individual sub blocks (eg: post meta block) living at the top directory level a la the single column block? |
In the context of loops this block would work rather like a template. |
I love the idea of combining a Some questions:
|
Thanks for chiming in @luisherranz I saw that block, it bundles a lot of customization options in a single block (similar to "Latest Posts" in core), which is what I'm looking forward to exploring here as a more flexible and usable alternative. Related: #16283
Pagination as slideshow-style or as navigating to another URL? |
Well, I was actually thinking about pagination to another URL, like I know that's probably way more complex than your original idea, so it's just a thought... But it could solve a pattern that has not been easy to solve in the past: lists of posts based on custom queries. Some examples that require code right now but could be solved with a
Besides, users would have much more freedom when choosing the way those posts are displayed thanks to the child blocks. |
Oh, this would be part of work on dynamic pages that map to the template hierarchy and includes archive pagination. Those would have the concept of main query / loop or something similar, but is a bit beyond the scope of this one. |
Glad to hear there are plans for that :) |
Worked up a flow for how a Post block could work in Gutenberg, using the newer block UI and taking a few liberties. You can take the Figma prototype for a spin yourself to get a better feel for it: https://www.figma.com/proto/Lnc1Z6PLVIwGyn21a724e6/Blocks-Suite-of-Post-Blocks?node-id=47%3A0&viewport=-7295%2C-71%2C1&scaling=min-zoom |
Post Tags block was merged, so I checked it off the list. #19580 |
Post Author block has also been merged. #19894 |
Going to close this issue now that we have most of these blocks. We should explore improving these blocks on specific issues. |
It'd be great to create a pattern / variation with something similar to the original design from this issue to determine what is still missing. |
So I was able to get the "content" of the screenshot above. Here are the limitations I found:
Maybe we can make some issues based on this or consolidate into other existing issues? cc @MichaelArestad @shaunandrews |
Let's add these to the query block milestone as well #24762 cc @ntsekouras |
Created a discussion issue here: #25394.
Edited this issue: #24934 to include the above.
New issue here: #25410 |
I've made a few other issues related to Query Loop block and display. Some are just questions like "how might we make a design like this with the Query block", but all of them have a visual similar to the one in this issue that I anticipate users wanting to see in themes or have access to via Patterns. I have more "out there" layout ideas. If it's helpful to open issues like these I can keep doing :)
|
We currently offer a "latest posts" blocks with some configuration options which can be pretty nice for setting up homepages with some dynamic content arranged in different sort of grids and lists. There is also some ongoing work to include showing a featured image and the post excerpt as features than can toggled on the block settings.
However, it is clear such a block won't scale to offer all the flexibility that a proper post loop on a theme provides — it's not just showing elements (date, author, and so on) but also their positioning — nor the best editing experience either compared to more granular blocks.
What would be interesting is to explore a "Post" block that works as the wrapper for the
post_ID
context, and which contains an inner blocks area with several available child blocks:This would allow displaying a "post" element in any context and with full flexibility.
Furthermore, this block can support templates, so on insertion it can offer a few defaults (just post title, post title and excerpt, featured image to the side, etc).
Starting with a single post would allow us to determine how the child blocks should be structured. By having each element be a child block, we can also expand on the configuration options much more elegantly: the date format display would be easier to connect, the excerpt can offer to customize the number of words and the trailing cutoff, the image can have specific settings, and so on.
If this proves convenient, we can then look at a more general purpose
Query
block that would allow to control the query parameters and then use the "post" block for display. This could be super useful for themes to build sophisticated static pages with dynamic content but full control over layout and content.The text was updated successfully, but these errors were encountered: