Skip to content

Block request: post field #29173

@carlomanf

Description

@carlomanf

This is a request for a new block, which I would consider naming something like "Post Field" or "Post Part" or "Post Section"

What problem does this address?

The main problem solved by this new block is that a post can only have one post content, but one post content may not always be sufficient.

For example, you might want to build a block-based theme where every post gets its own unique sidebar, rather than share the same sidebar with the rest of the site. This could be thought of as a "second" post content for the post.

What is your proposed solution?

This block would work similarly to the post content block, but each new instance of the block would require the user (or more likely, theme developer) to nominate a postmeta key to store the content. This would effectively let each post have multiple post content fields. It could look something like this:

<!-- wp:post-field {"key":"sidebar"} /-->

This block could be used directly within any singular template, within a query loop, or even within the post content as a kind of "local" reusable block. If it's used in the template, which I see as the biggest use case, its content can be edited using the template mode in the post editor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    New BlockSuggestion for a new 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