You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is a summary of the different states the navigation block can be in, and how we should handle editing and saving it in each case. This is quite a big departure from how things work today technically.
Empty Navigation Block
Assuming an empty navigation block on the page….
When the user has no navigation menus (classic or CPT), show a page list block on both the frontend and the editor
When the user has only one navigation menu (classic or new) we show this menu on both the frontend and the editor. This is not considered a “dirty” state, since the frontend and the backend are the same.
When the user has multiple navigation menus we try to find the one with a slug that most closely matches the position of the block in the template, and display that in the frontend and the editor. If a user only has classic menus then the menu saved to the “primary” location should be used. Navigation menus CPTs will take precedence over classic menus.
When the user modifies the block, in any of the above scenarios, the edits are NOT saved to the database, instead the block becomes a dirty entity. No changes are made to the front end of the site.
Existing Navigation block
If the user has a navigation block that already has a connection to a navigation menu CPT
We show the same thing in the frontend and in the editor
If they make an edit, no change happens in the database (effectively the change is stored in memory in the client), and the navigation block becomes a dirty entity
Create new navigation
The user can select “create new menu” from the block toolbar. The should also be able to select this “Start empty” from the inspector when the block is in a fallback state (or maybe at any time).
A new empty navigation menu is displayed in the editor, but no change is made to the frontend
Nothing is yet saved in the database
Changes made to the block are stored only in memory in the editor
Saving navigation
When the user hits save they get the option to save their navigation menu, like the ones for site title and templates, because its a dirty entity (see image below). If they save the block to a navigation menu (the default) then the frontend updates to match the editor.
The text was updated successfully, but these errors were encountered:
This is an overview Issue to track the requirements to fix and improve the fallback and entity saving states for the Navigation block.
Where possible, the aims are:
Tasks
Summary of States for Block
Below is a summary of the different states the navigation block can be in, and how we should handle editing and saving it in each case. This is quite a big departure from how things work today technically.
Empty Navigation Block
Assuming an empty navigation block on the page….
Existing Navigation block
If the user has a navigation block that already has a connection to a navigation menu CPT
Create new navigation
The user can select “create new menu” from the block toolbar. The should also be able to select this “Start empty” from the inspector when the block is in a fallback state (or maybe at any time).
Saving navigation
When the user hits save they get the option to save their navigation menu, like the ones for site title and templates, because its a dirty entity (see image below). If they save the block to a navigation menu (the default) then the frontend updates to match the editor.
The text was updated successfully, but these errors were encountered: