-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
[Block] NavigationAffects the Navigation BlockAffects the Navigation Block
Description
Switching from Twenty Twenty-Two to another block theme resets the navigation.
Technically, it's because the navigation data is stored inside the template parts, for example:
<!-- wp:navigation {"layout":{"type":"flex","justifyContent":"right","orientation":"horizontal"}} -->
<!-- wp:page-list /-->
<!-- wp:navigation /-->
The next theme is not aware of any customizations made and comes with its own presets. One theme I saw was preset to render a classic menu:
<!-- wp:navigation {"__unstableLocation":"primary"} -->
<!-- wp:navigation /-->
A different approach would be to infer the location/slug from the surrounding templates / template parts and use that to infer the new localization for the menu.
Prior discussions:
- Assign a unique slug to navigation blocks and wp_navigation posts #36828
- Navigation Areas are overly complex #36524
- [Draft] Use template parts to preserve navigation between theme switches #36117
- [Try] menuSlug instead of navigationMenuId #36522
When this is implemented we should also consider the implications of #42600
getdave, chrion02 and JosVelasco
Metadata
Metadata
Assignees
Labels
[Block] NavigationAffects the Navigation BlockAffects the Navigation Block