Skip to content

Query block: Add a configurable "no posts found" state #36609

@jameskoster

Description

@jameskoster

This is particularly important for the search template in block themes. Currently, if a search returns no results then the query renders nothing on the frontend:

search.mp4

Ideally it should at least inform the visitor that no results were found for their search term. But it would be better to offer folks a way to customise this state with blocks.

Some design consideration will be required here, as blocks cannot currently entertain multiple states.

This affordance could also be useful in other scenarios:

  • Post Content block – enable users to control how password protected posts appear
  • Design separate empty / full states for Shopping Cart blocks in plugins like WooCommerce
  • Log in / out block – finer control of each state

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DesignNeeds design efforts.[Block] CommentsAffects the Comments Block - formerly known as Comments Query Loop[Block] Query LoopAffects the Query Loop Block

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions