WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.36k stars 4.13k forks source link

Consolidating the Query Loop block, Latest Posts block and Post Lists block #32332

Open paaljoachim opened 3 years ago

paaljoachim commented 3 years ago

Description

At the moment there exists three blocks that to me seems to do the same thing. The Query block, Latest Posts block and the Post Lists block.

Post-lists

It seems like the settings vary a bit between the blocks as well.

My expectation is to have one block that covers what is needed to show Posts or a CPT, with a few different filters on how I would like to show the Posts/CPT on each page. Having three block options to choose from is very confusing.

Consolidating the three blocks into one block would be helpful, as a user would then be able to select the specific block to do what is needed to show the specific content.

mrfoxtalbot commented 3 years ago

I would argue that the Page List block should also be merged/consolidated.

Screenshot 2021-06-06 at 12 16 27
javierarce commented 3 years ago

Combining those four blocks into one is a great idea.

In the case of Post Lists block, it would be quite easy since it’s the same block under a different name. 



Page List block would also be trivial to combine, and the users would benefit from having more control over the results since this block just spits out a list of all the pages the user has.



The only thing users would lose if we got rid of this block would be the possibility to create a bulleted list, something that I’m not sure it’s possible to achieve in an easy way using the Query block.


Latests Posts (LP) would be a little more difficult to remove right away because it has some nice settings that are a bit difficult to achieve with the Query block

.

Here’s a table with the equivalent methods and some pros/cons for the alternative method in the Query block (QB):

LP setting QB solution QB pros QB cons
Dividers Separator block Users can change the type of border and its color The divider has a fixed width.
Border Grouping the post and setting the border More options to change the type of border Difficult for the average user?
Post Content Post Content block
Excerpt Post Excerpt block It's not possible to set the maximum number of words
Author Post Author block It gives more configuration options like avatar, bio, or byline
Post Date Post Date block Gives more customization options like date format, color, typography, or even link it to the post
Featured image Post Featured Image block The block gives less control over the image than the Latest Posts block, where users can change width, show thumbnail or full image, etc. There's a ticket that will solve this.

Finally, the Latest Posts filters are similar to the ones in the Query block, but in the Latest Posts block, users can change the number of items from the sidebar.

javierarce commented 3 years ago

While I was thinking about this issue, I thought of another idea: instead of consolidating these blocks into one, would it make sense to leave them as independent blocks but make them all use the Query block internally? The only difference would be that initially, they would have different settings to render each kind of list.

javierarce commented 3 years ago

After thinking for a while about this issue, I think that my second idea makes more sense. The basic Query block should be a powerful and "content agnostic" block, probably more oriented towards advanced users with specific needs (like theme developers).

The other blocks would use the Query block internally but start with a different set of defaults, reducing the number of blocks to maintain and offering a similar experience to the user while at the same time helping them to find an appropriate block faster.

Another important thing we'd need to pay attention to is the name of the block in the sidebars. Right now, if a user inserts a Posts List block, the List view and the right sidebar show "Query Loop", making the interface disorienting.

Screenshot 2021-07-05 at 14 04 47
javierarce commented 3 years ago

I found this ticket by @jameskoster that has a more comprehensive list of enhancements and ideas about the Post List block https://github.com/WordPress/gutenberg/issues/32268

jarekmorawski commented 3 months ago

FWIW, we faced a similar issue with the Product Collection block in WooCommerce. We decided to merge all block variations into one and surface them in the Inspector and block toolbar.

image

Happy to provide more information and the designs if you're interested.

paaljoachim commented 3 months ago

Hey @jarekmorawski

Thank you for the feedback to various issues! It is greatly appreciated! Do please add the designs.

Thank you again!