Open mtias opened 1 month ago
How do you see this kind of feature being "declared" for block types. In other words, until now, block types were not aware about whether they are in "content only" mode or not. We only detected blocks that have a "content" role attribute and allowed some specific behavior there. How do you see that evolving, should block types receive some kind of isSection
flag and enable/disable behavior.
I don't think we should abstract this too soon. The navigation block already has a special tab in the inspector, so perhaps it's part of formalizing that view down the road. Conceptually, I don't think blocks should be made aware of "modes".
I think we can tie this work into the content only stream as well as synced patterns in a few iterative ways.
It may look something like this
https://github.com/user-attachments/assets/e0456bda-d899-4710-bb94-0215b5943135
The above shows two ways of accessing a menu. The first via the content list, and the second via the canvas with an "edit menu" button that just opens inspector with menu tab open.
In future we can look at surfacing overridable properties directly vs drilling down like what is proposed above.
until now, block types were not aware about whether they are in "content only" mode or not.
Conceptually, I don't think blocks should be made aware of "modes".
If blocks are not aware of the mode they're in than something like #60412 can't work. Either the block tells the block editor that something is editable in content only, or the block editor designates what is content in content only. We went the first route and the block tells the block editor via the role prop of attributes what's editable in content only.
But the navigation block does not really have any content. The content is stored in the navigation link and navigation submenu blocks which are navigation block children. Updating the defition of these two types (link and submenu) to include role content on attributes whcih are content partly gets us there.
https://github.com/user-attachments/assets/d3a8f82a-cd94-4cee-9cf1-fab758f1fd79
But, what is lost, we can't see the tree of links 😢 However that seems to be an issue for the whole block tree which is flattened in content only.
About 2 there is something else to consider: if a user is only expected to replace pictures and text, then why do we expect them to rearrange the site's hierarchy?
This could work in a world where we show controls for every attribute with role content in the inspector. That could work by allowing blocks to register these controls for the inspector when they are in content only for whatever reason. Then the navigation block could register this whole list view thing.
A bit of trial and error:
BlockQuickNavigation
will not be shownSo we need some things to achieve this style of editing:
Follow-up from a discussion with @youknowriad we can update content only to:
This is a good start for an exploratory phase which could answer things like:
There should be a way to make edits to your menu while on content-only mode. The canvas edits should be restricted but the inspector menu should be reachable.
We should explore exposing the "menu list view" in the inspector of template parts or patterns that contain a menu when the user is on content-only mode.
There should be a clear way to reach that panel from the toolbar of the nav block and the template/pattern. Could be an "edit menu" that just toggles the inspector with the tab for the menu open.