-
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
[ Latest Posts ] Iterations to version 2 #20046
Comments
I'm a new contributor but I've been hacking and developing in Gutenberg for over a year for our clients. Including custom posts blocks. Feel free to push me in the right direction or assign me to anything appropriate! |
I recommend checking out the Custom Post Type block from Getwid. It is essentially a latest posts block for any post type. The template used for each of the posts in the list can be modified using the block editor. In other words, you can use the block editor to build a latest post item template, and then choose that template in the display settings of the block. It was certainly one of the most creative uses of the block editor I've seen in a plugin, and I think it could be used as inpsiration for something similar in core. |
I think instead of trying to add more and more features and toggles to this block, we should focus on the Query block which will have similar results with more flexibility. |
@youknowriad while it is true that the QueryBlock is upcoming, it is still something new which serves to a second step on this project, which is to refactor the However we can still add the features to the block and when we refactor they'll be there already. otherwise the block and the experience will probably lag a lot more time. Indifferent of the QueryBlock, at least to my understanding, LatestPosts will not be replaced, just refactored to use QueryBlock right? |
I kind of agree with @youknowriad that adding a lot of features to this block feels overwhelming from an experience point of view. I think there could be a balance between adding new features and not adding any. For example:
I think you could add those - more styling could also solve alignment by offering it as an option. |
Thanks for creating this issue Andrei! @draganescu I think we can portion it out a little more. Into additional stages. I am myself these days using this Latest Post block plugin: https://wordpress.org/plugins/post-type-archive-mapping/ |
I admit that I haven't delved into the specific code for post-excerpt block and it may be too late to do it, but why not build Latest Posts from it? |
Howdy @skorasaurus what do you mean build |
@karmatosed @paaljoachim @youknowriad all the items in this overview are meant for exploration, some have their own issues, some don't. Particularly those items that don't even have open issues are far from implementation. Design and conceptual phases will push them farther in time. Until then, the items that are possible now and which fit easily in the UX of the current block should be worked on within the possibilities that exist, right? Then, in the mean time, while new APIs make the This basically means that this overview issue is a conversation starter for many of the items it contains, less so an implementation directive. |
@draganescu I presume he means that the Latest Posts block could be built using a template for each of the post items, and you could build that template using the Post Title, Post Excerpt, and Post Meta blocks. The Custom Post Type block in Getwid uses a similar approach. |
Yes I am exploring building |
I've implemented a method to add multiple categories support. I've been working on the current Is the plan to build a new |
Would it be possible to allow Latest Posts block to curate specific posts from a Post Picker/Link Control vs a dynamic query e.g. manual curation of homepage posts hero/featured posts? |
@rickalee Is that related to the Latest Posts or should it be an own component? What's your thoughts @draganescu? |
Howdy @rickalee yes we need that too! It might be better suited for a stand alone block though? With the incoming The post ID based filter can be added but the hero or featured and other style of presentation get a bit out of the scope of "LatestPosts" :) Pherhaps like @karmatosed suggested this will either evolve into a more generic "Posts" block or be broken into many more specific ones (e.g. a hero post block, a featured posts block, a truely "latest" posts block, an author archives block etc. |
There's quite a bit going on here. My recommendation is to make some issues with specific ideas to pursue to move forward. It would also be good to try some of this with the upcoming query block instead. |
Howdy @MichaelArestad ! The issue has the label A few of the proposed issues for phase 2 are still open for discussion, and the point is if there is no issue linked, no one is interested enough in that feature. Is the query block ready and merged? |
One thing that would be good to have is the ability to show top commented posts in the latest post block. This would be a filter - sort by comment number. |
@dingo-d could you open an issue for this suggestion? |
Now that we have a merged Query Block (#22199) we could start exploring doing a feature freeze here and copying all the current LP block features to a new one implemented using the new Query Block. |
Yeah, maybe the Latest Posts block exposed in the inserter could just be a block variation of the Query block! |
It would be great with an update on this issue. @ntsekouras |
I updated some items from the issue that had been implemented. In general I believe the focus should be in augmenting the new Post Blocks, like We could probably close this Overview issue.. |
Yes I agree with @ntsekouras it does look like the use of this issue is questionable now. |
The
LatestPosts
block is one of the first blocks in Gutenberg and, also, one of the most important blocks for fast and easy full page building. This block has been iterated on from launch and in its current state can offer basic functionality for post listing pages.@melchoyce outlined in #1594 the improvements which the
LatestPosts
block needed in Jun 2017 and today, in February 2020, that list is almost complete - pending one exception: displaying featured images.Given the past iteration plan is done and that in the past three years the block gathered new ideas I propose this issue as an overview issue for new features that can be added into a, let's call it, a
LatestPosts
version 2.This version 2 of
LatestPosts
should include:Implement theLatestPosts
block as a variation of theQuery
block (issue: [ Latest Posts ] Implement the LatestPosts block as a variation of the Query block #24521)Featured image support, in its own sidebar section (issue: Show Featured Images on the “Latest Posts” block #17472, pr: Add featured images to Latest Posts block #17151)Featured image link (issue: [Latest Posts] Add link to featured image #21530, pr: Add option for adding link in featured image [ Latest Posts block ] #24548)Featured image alignment (see Homepage Articles by Newspack)Show author in posts (issue: Latest Posts Block: Option to show/hide the post author #17681, pr: Added ability to filter latest posts by author #16169)Filter posts by author (PR: Added ability to filter latest posts by author #16169)post
(issue: Update Block: Latest Posts CPT #9013, PR: Add CPT selector to Latest Posts #20831)Multiple categories support PR: Adds multi-select to categories on Latest Posts #20781 (see Homepage Articles by Newspack)August, 12, 2020 Edit: added on the list of tasks migrating the LP block to become a variation of the Query block.
There are a couple of things to keep in mind when developing for theLatestPosts
block, version 2:
With the advent of Full Site Editing there have been introduced a series of "Post Blocks", a set of blocks that can be used to describe and build a whole post in the context of a site page. These post blocks can be used to compose a full post and then display it in a loop.
The current implementation of
LatestPosts
uses custom HTML to create the post structure in the loop. Optionally, if development of theLatestPosts
version 2 takes a lot of time and the post blocks mature, we could implement the loop using these new blocks.The more filtering features we add to the
LatestPosts
block the more it looks like aQuery
block, a block which doesn't exist yet but which could exist at some point (see issue: Query Panel Design / API (Latest Posts, Calendar, etc) #2662 and prs: Create Query Block #20106, Implemented query panel in latest posts block. #3198 taking the first steps in this direction).This block would be a generalization of a block that can allow a user to visually customize a
WP_Query
for a specific post loop, ideally offering all the options that WP_Query does. We can either end up with bothLatestPosts
andQuery
blocks and use them when appropriate, or we can, at some point in the future, evolveLatestPosts
into a more generic, all encompassing,Query
block.Are you a new contributor?
This issue itself is big but it can, and will, be divided into smaller issues (some already exist). Trying to implement any of the missing features above is a great way to start contributing to Gutenberg with code. Also reviews of open PRs, suggestions and perspectives on open issues, are of great value as well. If you want to help but have questions, please leave a comment here so we can discuss what would be the best next step for you.
TL:DR;
Having a more feature complete
LatestPosts
block is a priority for this year as it is a cornerstone of giving users easy control on post listings when working with Full Site Editing on their pages. Therefore jump in and let's build the best and most user friendly post listing block in the world!The text was updated successfully, but these errors were encountered: