Site logo

[Resolved] Possible to build this kind of mega menu with the gp simple mega menu

Home Forums Support [Resolved] Possible to build this kind of mega menu with the gp simple mega menu

Home Forums Support Possible to build this kind of mega menu with the gp simple mega menu

Viewing 15 posts - 1 through 15 (of 31 total)
  • Author
    Posts
  • #2576831
    Benny

    Hey there, is it possible to build a mega menu (with the simple mega menu from the docs), where one could hover over the parent links and everytime there are other sub-“links”? I attach an image, so that you get what i mean. Thank you!

    https://ibb.co/4ZgSmrj

    #2577139
    David
    Staff
    Customer Support

    Hi there,

    i don’t fully understand.
    In the image there is three columns. Do you mean if you hover on items in the left column it shows its submenus in the middle column and so on?

    #2577200
    Benny

    Thanks for the quick reply.

    I meant, if one hovers on the links in the header, that the menu changes its submenu items.

    #2577323
    Ying
    Staff
    Customer Support

    I don’t fully understand either, can you link us to the example site?

    #2577422
    Benny

    I have a figma layout and have to build it myself.

    There is just the header bar with several linked sites, where i can hover over and the menu appears but shows different linked sub-sites according to the parent-site / topic.

    In the sample implementation there is just one linked site where the menu unfolds. The other pages are normaly linked and and can be clicked.

    Maybe i need just more mega menus in the header bar?

    I will find an example how this works on other pages, maybe this shows it better.

    #2577705
    Ying
    Staff
    Customer Support

    I’m sorry but I really don’t understand what you mean.

    Can you link us to the example site and tell us the steps to see what you mean?

    Let me know!

    #2578355
    Benny

    Here we go. Every parent link has a different submenu –> https://dynamics.microsoft.com/de-de/

    I would rather use hover instead of click action but this is close to the menu i want to build.

    Thank you for your effort!

    #2578802
    David
    Staff
    Customer Support

    The Simple Mega Menu CSS will do something very similar to that, you can apply it to as many menu items as you like. And it will work by default on Hover.

    In your original image though there was other types of content in the sub menu eg. blue contact box. Is that a requirement ?

    #2578959
    Benny

    Yep, but i thought i could maybe hook it into the submenu easily?

    I appreciate your help and patience very much!

    #2579461
    David
    Staff
    Customer Support

    You can try the the PHP Snippet in my GIST I have here for adding the hook inside a menu item:

    https://gist.github.com/diggeddy/d536a711522f37fd54e6118a18d80f26

    #2583766
    Benny

    Is it possible to give the sub-menu inner a max-width but keep it 100vw? I added the code already and im on a good way –> http://dynamics.8tdqsf2iwx-zqy3jye103kg.p.temp-site.link/

    #2583981
    David
    Staff
    Customer Support

    You would do something like this:

    1. Make the mega-menu submenu a flex container and justify the content center:

    .mega-menu .sub-menu {
        display: flex;
        justify-content: center;
    }

    2. Create a CSS Rule for the mega menu columns eg. mega-menu-col-3
    And set the individual Columns width eg. 400px. So the total 3 column width will be 1200px.

    
    .mega-menu-col-3 .sub-menu li {
        max-width: 400px;
    }

    Repeat that logic for the other column settings you use

    #2584371
    Benny

    Problem is, i have 3 columns but not always and it should be aligned with the logo. Isnt it possible to build it entirely with generateblocks (wouldnt be a huge problem then).

    The hook you posted above isnt working either (or i did something wrong).

    #2585375
    David
    Staff
    Customer Support

    Ah apologies, that GIST was part of a larger project. I have just updated it so it can be used in isolation.
    I have updated the last comment. One minor change is the use of _ vs - before the item slug

    #2586037
    Benny

    Ah i see. Will try tomorrow. Would it be possible to hook the entire submenu in with this? So maybe one hovers over a menu item and in the appearing mega menu everything is built with generateblocks. So i could set the inner with etc.

Viewing 15 posts - 1 through 15 (of 31 total)
  • You must be logged in to reply to this topic.