Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically utilise classic menu when switching from classic Theme #42600

Closed
Tracked by #39324
getdave opened this issue Jul 21, 2022 · 6 comments
Closed
Tracked by #39324

Automatically utilise classic menu when switching from classic Theme #42600

getdave opened this issue Jul 21, 2022 · 6 comments
Labels
[Block] Navigation Affects the Navigation Block [Focus] Blocks Adoption For issues that directly impact the ability to adopt features of Gutenberg. [Type] Feature New feature to highlight in changelogs.

Comments

@getdave
Copy link
Contributor

getdave commented Jul 21, 2022

What problem does this address?

When switching from a Classic Theme (with a Menu assigned to a Menu Location) to a Block Theme with a Navigation block, the block is currently empty.

This provides a suboptimal UX and could be improved.

What is your proposed solution?

On theme switch, the block should:

  1. Attempt to find the classic Menu that was assigned to the primary Menu Location.
  2. Convert the Menu into a block Navigation Post wp_navigation.
  3. Automatically use the new Navigation Post in the block.

This should happen without user interaction and should work in the same way across both the Editor and the front of the site.

Note however, that this should be considered part of the auto-assignment mechanic. Therefore, if the block detects that a wp_navigation already exists in the database, it should prefer that over converting the classic menu. This is however, likely to be an edge case.

@getdave getdave added [Block] Navigation Affects the Navigation Block [Type] Feature New feature to highlight in changelogs. [Focus] Blocks Adoption For issues that directly impact the ability to adopt features of Gutenberg. labels Jul 21, 2022
@getdave
Copy link
Contributor Author

getdave commented Jul 21, 2022

Related #42601

@annezazu
Copy link
Contributor

annezazu commented Oct 15, 2022

Noting that this current experience came up as a pain point a few times in the seventeenth call for testing for the FSE Outreach Program:

I noticed that when I switched from Twenty Twenty One to Twenty Twenty Two the navigation changed and lost the previous menu. That’s unexpected and not great. I also noticed that the menu turned into a page list block. I guess this is the “most likely fallback” mentioned earlier in the call for testing description?

Click to make sure an individual link is selected. Then an Edit link is seen in the toolbar. Converting links. Ahh it converts all the links at the same time. Clicking into the various links I do not see the edit link any longer. I found this process a little confusing. Why do I need to convert links in the menu?

I feel like novice users likely don’t know the implication of what will change with their theme. They might assume that the colors/styles may change, but not necessarily structural changes (like having to re-do the menu).

I've added it as part of the theme switching flows tracking issue as this latest call for testing showed how impactful it would be to resolve.

P.S. it's not clear to me necessarily how this relates to this recent merged PR: #44173 It seems like issue is likely broader in scope than that specific use case.

@getdave
Copy link
Contributor Author

getdave commented Oct 17, 2022

@annezazu I believe #44173 does partly solve this issue as it will import the most recent classic menu if no block-based menus exist.

It does not import based on primary though so that's something to look out for.

In the future we might make it import from primary or explore other heuristics to try to ensure the "correct" menu is utilised in the block.

@strarsis
Copy link
Contributor

strarsis commented Nov 21, 2022

@getdave: Is it possible to make a Gutenberg navigation menu the primary menu, or have slots, similar to what Block part areas do? Currently when I use a block part for the site header I have to manually select the primary menu for the first time, otherwise it shows the last menu that was added.

Currently a core/navigation-menu block would use an ID to reference to a specific Gutenberg menu:

<!-- wp:navigation {"ref":87

This would be much more robust and avoid the need to set the proper primary menu after a block part reset or initial setup:

<!-- wp:navigation {"ref":"primary or menu area slug or some other mechanism"

Related issue comment: #38166 (comment)

Edit: Apparently these kinds of "navigation areas" were deprecated: #36524 (comment)

@getdave
Copy link
Contributor Author

getdave commented Nov 21, 2022

@getdave
Copy link
Contributor Author

getdave commented Mar 17, 2023

The auto import of a Classic Theme has been implemented. Closing.

@getdave getdave closed this as completed Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Focus] Blocks Adoption For issues that directly impact the ability to adopt features of Gutenberg. [Type] Feature New feature to highlight in changelogs.
Projects
None yet
Development

No branches or pull requests

3 participants