Today, I thought I would tackle trying to implement something like a megamenu in Elements.
At first, I tried to do this with a mix of core components and a custom component, but that did not end well. So I went back to a combination of the standard MENU component and a custom component. This was a lot harder than it should have been, largely because it is impossible to hook into or customize the standard menu.
The only way I could get it to work is by utilizing the right drop zone in the menu. This, by itself, was an exercise in futility, as you have no control over this drop zone.
But anyway, I persisted and was able to create something close to what I had in mind. The custom component has a trigger, which was placed in the drop zone. When you hover over the trigger, the megamenu opens below the navbar. It stays in place until you move out of it.
Here is what it looks like on the screen.
The question I would like to pose to @dan and @ben is how something like this could be hooked up to one of the menu items in the standard menu. Ideally, I want to assign this behavior to one of the menu items and have that item trigger the display of the megamenu. That way, I don’t need to create the trigger as part of the custom component, which brings up a whole raft of problems.
Ideally, we would have support for something like this built into the standard menu component, or a separate component provided by Elements. But, seeing as that is not forthcoming, I was forced to go down the custom road. But I’m stymied by the fact that I cannot easily hook into the standard menu.
I did explore creating a completely custom navbar built with core components, but that did not ease the problem of integrating the custom piece with the parts built with the core.
I would appreciate some guidance on how something like this could be easily accomplished.
BTW, I also added a bunch of properties to the custom component to make it easier to set up some of the information. This includes the ability to show/hide the megamenu in the editor. The content of the megamenu is all made with the core components, as there is a single drop zone within the megamenu into which the content can be added.
I look forward to hearing what thoughts the team and others have about creating something like this in Elements.


