Skip to content

Expanding the Editor outside of post_content #16281

@youknowriad

Description

@youknowriad

One of the main important requirements to build a full site editing experience is the ability, for the block editor to edit both the post/page object and its associated block template at the same time.

The current implementation of the EditorProvider component makes an important assumption that need to be reconsidered:

  • Parsing and hydrating changes are highly coupled with the post_content post object's property.

For full site editing, the list of blocks to be edited is extracted from the template object instead and "augmented" using the blocks stored in post_content if needed (if a core/post-content block is used in the template).

The initial step to achieve the required flexibility here is to consider the editor screen as it exists today as an editor built around a frozen block template composed of two blocks: A post title block and a post content block.

const template = [ 
  { name: 'core/post-title' }, { name: 'core/post-content' } 
];

const post = { title, content, ... };

const Editor = <EditorProvider template={template} post={post}><BlockList /></EditorProvider>

Related #16075 #13489

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrameworkIssues related to broader framework topics, especially as it relates to javascript[Type] TaskIssues or PRs that have been broken down into an individual action to take

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions