Site Editing: Template block states #27064
Labels
[Feature] Blocks
Overall functionality of blocks
[Feature] Site Editor
Related to the overarching Site Editor (formerly "full site editing")
[Type] Discussion
For issues that are high-level and not yet ready to implement.
Blocks that reference post data are unique in that they need to be aware of various different contexts, and appear in different states on the Canvas depending on what task user is currently undertaking.
Consider the existing "Post Title" block...
State 1
If I am editing a template like
single
with no content loaded as context, the Post Title block should display a generic placeholder that presents a rough demonstration of what it will look like on the frontend.As I am editing a template, the contents of the block should not be editable, but I should still be able to manipulate the controls to change the position, the width, the heading tag, etc.
State 2
If I am editing a template and have loaded a post in as context, the contents of the Post Title block should reflect the title of that post. But like state 1, as I am editing a template it should not be possible to edit the contents of the block.
Design work needs to be done to determine if this state is something we actually need. It is seemingly undecided whether content should ever be loaded in to template editing, or whether users should instead switch between template / content editing views.
State 3
If I am editing an item of content (like a post) and the Post Title block appears on the canvas as part of the template, I should be able to directly manipulate the content, but not controls like width etc, as those are attached to the template.
State 4
When I draft a new post, the Post Title block will appear on the canvas in an empty state. I should probably see an "Enter your post title" or similar placeholder in lieu of actual content. As with state 3 I should not be able to change edit controls as the block is part of the template.
State 5
This final state is probably the most contentious as I am not entirely sure this should even be possible. However, if I am editing a post and insert the Post Title block in to the content, it's likely that I want to reference and link out to another post on my site. I should therefore probably see a "Select a post" interface / placeholder.
I believe each of these states can be applied to all of the existing "Post" blocks (Post Author, Post Date, etc), and probably many of the upcoming template tags as well. So we likely need a system that all of these blocks can utilise.
As a part of this work we should also consider updating the block names and descriptions to accommodate these different situations. The current "Add the title of your post" description of the Post Title block is not appropriate when editing a template. I'm optimistic we can come up with a single description that fits all states, but perhaps this will need to be context aware as well.
Given the current shape of the Site Editing project, I suspect states one and two could be considered the priority.
The text was updated successfully, but these errors were encountered: