-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
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>