Skip to content

Iterations on "Latest Posts" Block #1594

@melchoyce

Description

@melchoyce

This description has been edited — please see issue history for older mockups!

Next steps

  • Featured image support, in its own sidebar section.
    • Include core image size controls.
    • Include core alignment controls.
  • Post content support, in its own sidebar section.
    • Toggle on/off post content.
    • When post content is toggled on, choose between excerpt or full post. (Am I missing a default core option? If it's just the two, maybe this should be a radio button instead).
    • Slider to control excerpt length when the excerpt is selected.
  • Post meta support, in its own sidebar section.
  • Organize settings

Why

In preparation for working on page templates in Gutenberg, we'll want a robust set of dynamic blocks that can be dropped into any post or page. Expanding this block will put us in a better position to tackle more complex dynamic or global blocks in the future.

Users shouldn't have to know how to write custom queries or understand the loop to add some posts to their homepage. The Recent Posts block is a great start, but to be a fully functioning solution, it needs to support more than titles and post dates.

What's changed

Before

image

image

After

recent posts list all

recent posts grid all

  • Added support for featured images, post content and excerpts, and post meta.
  • Reorganized the sidebar settings into groups.
  • Used the new Toolbar grouping design (unsure if this has been implemented yet).
  • Updated the icons, but this is optional, we can continue using the existing Dashicons for now.

View the complete prototype.

Future iterations

h/t @paaljoachim for a couple of these suggestions:

  • Expand on taxonomy offerings, like tags.
  • CPT support.
  • A way to update the "read more" text.
  • A way to rearrange all the elements inside of the block — move up meta, move featured image below title, etc.
  • Potentially display comment information (like # of comments).

Note to new contributors

This issue itself is big but can be divided into smaller tasks which should be a great way to start contributing to Gutenberg with code. If you want to help please leave a comment and we will discuss what would be the best next step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Block] Latest PostsAffects the Latest Posts Block[Feature] BlocksOverall functionality of blocks[Feature] Widgets ScreenThe block-based screen that replaced widgets.php.[Status] In ProgressTracking issues with work in progress

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions