-
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
Try using the excerpt block to display format like posts #53465
Conversation
Warning: Type of PR label error To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. |
In fact, when we toggle this option, we miss the excerpt for titled posts, I guess we could have it twice, but that's kind of confusing? I do like the possibilities this enables, we just gotta tweak the UX |
/cc @WordPress/block-themers you bunch should have a look at this |
Thanks for exploring. I'm a little concerned about adding more toggles, vs. adding better smarts in the query loop and the interface itself. I think @richtabor had thoughts on this as well. |
I think the toggle is needed because we reuse the block for multiple purposes. It's easy to default the excerpt to 1st block if three is no title even without the block, but in the loop when a post has title and body but you don't want the excerpt what to do? :) |
I mean instead of the toggle, we have some smarts that make the use case happen without having to find the toggle in the first place.
I'm most likely missing a little additional nuance, but in this case would we ever want to both show excerpt and post content together? |
No, we want to show either the title or the content if there is no title. |
Right, so in principle in the query loop we could be smart about it, and note that if there's post content AND an excerpt block, show only post content? Apologies if I'm missing more nuance, it's been a long week. |
No need for apologies :D maybe it's super clear to you and I don't see it. Let's go through this:
To avoid, with no toggle, rendering title and excerpt, we should manually code into the query loop that if there is a title the excerpt should only render if a manual excerpt is set. But what if someone does not want this, and they want titled posts to render title, excerpt and title less posts to render1st block? How can the user override the behavior of the query loop without any UI to do it? I think if we aim for a more seamless behavior we should instead update the title block to render the 1st block if there is no title. This seems more obivous than wrangling when to have and when to not have an excerpt, and could work without any toggle. |
This has been a nice exploratio but definitely using a block to trick the rendering of the loop is not very elegant, while smart. With a toggle or a smart behavior it's still weird. In wp-format-enabler i am exploring alternatives that work with the query loop and post template. |
What?
Idea for #28564
There was plenty of feedback in #53049 about the usefulness of post formats and how although supported they're hard to figure out when one uses a block theme.
Why?
One thing about post formats is that they overlap a lot with CPTs. To render a special template for a special kind of post we have CPTs which can have their own single and archive templates. Post formats on the other hand use the standard post template but as taxonomy allowed special rendering in the loop, particularly for title less situations (e.g. a status post).
This exploration aims to see if simply fixing the part around query loop rendering is enough to replace the need for post formats: after all a post with one image block is an image post format, a post with one paragraph block can be a status format or a link format etc.
How?
Makes the excerpt block
Testing Instructions
In a block theme:
Testing Instructions for Keyboard
N/A
Screenshots or screencast
excerpt-1st-block.mp4