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

Keyed post content #41073

Open
carlomanf opened this issue May 14, 2022 · 1 comment
Open

Keyed post content #41073

carlomanf opened this issue May 14, 2022 · 1 comment
Labels
[Block] Post Content Affects the Post Content Block Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement.

Comments

@carlomanf
Copy link

This is a request for a new "key" attribute for the Post Content block, which would enable posts to have multiple post content instances identified by keys.

This issue supersedes #29173, which proposed it as a separate block rather than an attribute.

What problem does this address?

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

Themes have often supported "multi-panel" content on front pages but there hasn't been a standardised way to do it. A good example diagram is available for the Pique Theme, which accomplished it in a pre-blocks environment using the customiser and extra pages. Some other themes, such as StudioPress themes, used widget areas.

This new block attribute could be a standardised way for themes to build these kinds of front pages, as well as post type templates.

What is your proposed solution?

The user would interact with a keyed post content block similarly to the un-keyed post content block, with the key being used to store the inner blocks in the postmeta table rather than in the post_content column. A prefix would be used to avoid collisions with existing postmeta keys. This would effectively let each post have multiple post content instances identified by keys. It could look something like this:

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

A keyed post content block could be used in a post type template, a front page template or within a query loop. If it's used in the post type template or front page template, its content can be edited using the template mode in the post editor.

@bph bph added the Needs Technical Feedback Needs testing from a developer perspective. label May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Content Affects the Post Content Block Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants