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

Tutorial: Creating a mega menu with the block system #197

Closed
bph opened this issue Jan 4, 2024 Discussed in #182 · 8 comments
Closed

Tutorial: Creating a mega menu with the block system #197

bph opened this issue Jan 4, 2024 Discussed in #182 · 8 comments
Assignees
Labels

Comments

@bph
Copy link
Collaborator

bph commented Jan 4, 2024

Discussed in #182

Originally posted by justintadlock December 13, 2023
First, I want to say that this is a REALLY rough idea. One of the downfalls of the block system (really, even classic theming) is that there are no easy ways to create mega menus. And if I had a nickel for every time a developer asked me about this, I could at least buy myself a dinner at a fancy restaurant.

I'm just throwing this topic out here to talk ideas/solutions at the moment. It's not formed well enough to approve it as a topic on the blog. Think of this as more of an open invitation to answer:

  • Are mega menus possible with the block system?
  • If so, can we build something that's user friendly with the tools at hand?
  • If so, can we explain this through a tutorial?

I've heard some ideas tossed around using patterns or template parts. I'm going to try to explore some options through code in January, but I also want to make sure this is wide open for feedback/discussion.

@bph bph added flow: needs input let's discuss this. flow: approved can move forward Themes and removed flow: approved can move forward labels Jan 4, 2024
@justintadlock
Copy link

I think this one got approved a little ahead of what I was prepared for. I'd still like for us to continue the discussion around code solutions in this ticket.

I know that this is possible since I've seen a couple of implementations, but I also don't know how to approach it. Yet.

@brettsmason
Copy link

Following up on our Twitter exchange, I'd love to help progress this in any way I can. I've been trying on and off for a few months to find a solution to more complicated menus in block themes, but have so far come up short.

I recently did some research on menu implementations around larger sites and put together a Figma file with my findings.

It feels like the core problem is the lack of flexibility to include more block types within a submenu, as its very restrictive at the moment. The ability to include columns for example would be good.

I think the menu block in general is too focused on one style of (simple) navigation, but that's likely a seperate issue.
If I can provide any further information that may help then let me know.

@justintadlock
Copy link

Thanks, @brettsmason. That's very helpful feedback. I've got an idea or two that I want to test out, but those will have to wait until at least next week.

@justintadlock
Copy link

Tested out an idea with the upcoming allowedBlocks filter: https://make.wordpress.org/core/2024/01/31/whats-new-in-gutenberg-17-6-31-january/

Early idea shared in a video here: https://twitter.com/justintadlock/status/1753593003266932887

@ndiego ndiego self-assigned this Feb 14, 2024
@ndiego
Copy link
Member

ndiego commented Feb 29, 2024

This one is ready for its second review, thanks @bjmcsherry for doing the first review.
https://docs.google.com/document/d/1SHHlMjQ-alxx1ijpoZCZ1qDMxFhHhqO1IgP4kzF8I1w/edit

@ndiego ndiego added flow: needs review reviewer wanted and removed flow: needs input let's discuss this. labels Feb 29, 2024
@justintadlock
Copy link

@ndiego - Really great work here! 🚢 when ready.

@ndiego
Copy link
Member

ndiego commented Feb 29, 2024

@ndiego
Copy link
Member

ndiego commented Feb 29, 2024

Social copy

Mega menus are one of the most commonly requested features for block themes. Learn how to build your own custom Mega Menu block using new features coming in WordPress 6.5, like the Interactivity API.

https://developer.wordpress.org/news/2024/02/29/an-introduction-to-block-based-mega-menus/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Published (Done)
Development

No branches or pull requests

4 participants