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

[ Latest Posts ] Iterations to version 2 #20046

Closed
draganescu opened this issue Feb 5, 2020 · 25 comments
Closed

[ Latest Posts ] Iterations to version 2 #20046

draganescu opened this issue Feb 5, 2020 · 25 comments
Labels
[Block] Latest Posts Affects the Latest Posts Block Needs Dev Ready for, and needs developer efforts [Type] Overview Comprehensive, high level view of an area of focus often with multiple tracking issues
Projects

Comments

@draganescu
Copy link
Contributor

draganescu commented Feb 5, 2020

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:

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 the LatestPosts
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 the LatestPosts 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 a Queryblock, 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 both LatestPosts and Query blocks and use them when appropriate, or we can, at some point in the future, evolve LatestPosts 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!

@draganescu draganescu added [Feature] Blocks Overall functionality of blocks Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Design Feedback Needs general design feedback. Needs Design Needs design efforts. Needs Dev Ready for, and needs developer efforts [Block] Latest Posts Affects the Latest Posts Block labels Feb 5, 2020
@draganescu draganescu added this to Backlog in Phase 2 via automation Feb 5, 2020
@Ringish
Copy link
Contributor

Ringish commented Feb 5, 2020

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!

@noisysocks noisysocks added the [Type] Overview Comprehensive, high level view of an area of focus often with multiple tracking issues label Feb 6, 2020
@ZebulanStanphill
Copy link
Member

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.

@youknowriad
Copy link
Contributor

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.

@draganescu
Copy link
Contributor Author

@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 LatestPosts block to be modular, to reuse existing blocks and make use of the context provided by a QueryBlock.

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?

@karmatosed
Copy link
Member

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:

Featured image caption (see Homepage Articles by Newspack)
Whole block caption (see Homepage Articles by Newspack)
More default block styles, especially needed once we add featured image (see Homepage Articles by Newspack)

I think you could add those - more styling could also solve alignment by offering it as an option.

@paaljoachim
Copy link
Contributor

Thanks for creating this issue Andrei! @draganescu

I think we can portion it out a little more. Into additional stages.
Version 2 could add some features. Get those in. Test it out.
Then create a version 3.

I am myself these days using this Latest Post block plugin: https://wordpress.org/plugins/post-type-archive-mapping/

@draganescu draganescu changed the title Iterations on "Latest Posts" Block - version 2 [ Latest Posts ] Iterations to version 2 Feb 26, 2020
@karmatosed karmatosed removed the Needs Design Feedback Needs general design feedback. label Mar 2, 2020
@skorasaurus
Copy link
Member

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?

@draganescu
Copy link
Contributor Author

Howdy @skorasaurus what do you mean build LatestPosts from PostExcerpt. To me they seem to be serving very differen usecases.

@draganescu
Copy link
Contributor Author

draganescu commented Mar 6, 2020

@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 LatestPosts block a good candidate for refactoring, items which will be implemented later will be so using the refactored and more modern block.

This basically means that this overview issue is a conversation starter for many of the items it contains, less so an implementation directive.

@ZebulanStanphill
Copy link
Member

@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.

@draganescu
Copy link
Contributor Author

Yes I am exploring building LatestPosts with composed post blocks but there are some limitations currently. See #19685 .

@Ringish
Copy link
Contributor

Ringish commented Mar 11, 2020

I've implemented a method to add multiple categories support. I've been working on the current LatestPosts but of course it will be able to lift it to any component. Here's a gif that shows the behaviour:
ezgif-3-7d71cf866e74
And here's my commit.

Is the plan to build a new LatestPosts component and toss the current or should we continue with the existing?

@paaljoachim
Copy link
Contributor

Hey @Ringish

It is awesome that you are working on multiselect! What about creating a PR?
I made a Add multi select drop down issue some time ago: #17009
It will be great to have multiselect included in Gutenberg that can be used for instance with Categories etc.

@rickalee
Copy link

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?

@Ringish
Copy link
Contributor

Ringish commented Mar 12, 2020

@rickalee Is that related to the Latest Posts or should it be an own component? What's your thoughts @draganescu?

@draganescu
Copy link
Contributor Author

draganescu commented Mar 12, 2020

Howdy @rickalee yes we need that too! It might be better suited for a stand alone block though?

With the incoming QueryBlock we will be able to build such specific post items queries and display them in custom hero or featured blocks. Until then we can either wait or build separate blocks for manual curation. Otherwise we could really bloat this block.

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.

@MichaelArestad MichaelArestad added [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later and removed Needs Design Needs design efforts. labels Apr 6, 2020
@MichaelArestad
Copy link
Contributor

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.

@draganescu
Copy link
Contributor Author

Howdy @MichaelArestad ! The issue has the label [ Type ] Overview and also there is a link for each of the items in the description to already open issues and latest PRs.

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?

@dingo-d
Copy link
Member

dingo-d commented Apr 30, 2020

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.

@draganescu
Copy link
Contributor Author

@dingo-d could you open an issue for this suggestion?

@draganescu draganescu removed [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later Good First Issue An issue that's suitable for someone looking to contribute for the first time [Feature] Blocks Overall functionality of blocks labels Jun 4, 2020
@draganescu
Copy link
Contributor Author

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.

@ZebulanStanphill
Copy link
Member

Yeah, maybe the Latest Posts block exposed in the inserter could just be a block variation of the Query block!

@paaljoachim
Copy link
Contributor

It would be great with an update on this issue. @ntsekouras
Based on your comment here: #20831 (comment) that seems to shake things up a bit.

@ntsekouras
Copy link
Contributor

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 PostFeaturedImage etc.. and make use of Posts List Query block variation.

We could probably close this Overview issue..

@draganescu
Copy link
Contributor Author

Yes I agree with @ntsekouras it does look like the use of this issue is questionable now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Latest Posts Affects the Latest Posts Block Needs Dev Ready for, and needs developer efforts [Type] Overview Comprehensive, high level view of an area of focus often with multiple tracking issues
Projects
No open projects
Phase 2
  
Backlog
Development

No branches or pull requests