Support » Fixing WordPress » Multi Column Menu

  • Hello,
    I am needing to create a Multi-Column Menu (essentially a Mega Menu) without a plugin. I’m expecting to use the Nav Menu Walker and set things up such that the user could get some minimal control over the columns by entering a specific class name in the menu entry (in the admin panel at “>Appearance>Menus>”.)

    I could explain why I’m needing to do it without a plugin ..but that could be a long drawn-out explanation.

    This is a somewhat difficult requirement. I’m sure there are right ways and wrong ways of doing it. If anyone here is aware of the proper way of approaching this I’d appreciate hearing it. Thanks.

    Patrick

    • This topic was modified 3 months, 1 week ago by patrick_here.
    • This topic was modified 3 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not a Developing with WordPress topic
Viewing 4 replies - 1 through 4 (of 4 total)
  • Unless you have a plugin supplying a menu block or a way to do menus differently, the menus are handled by the theme. So saying that you expect to use Nav Menu Walker doesn’t mean much (what code is using it?). WordPress is not outputting the menus (at least not until the core nav block is released). And the only way to add code is through a theme or a plugin. You can make a child theme that has a menu walker, but the menu is still just a list of lists containing links.

    You can look at this page for ideas on how to style menus: http://www.cssplay.co.uk/menus/

    Joy,
    Thanks for the reply and the link. It occurred to me that perhaps my question could have been more clear.
    Yes I’m aware that I would need to have wp_nav_menu() outputting the menu in some theme file (typically header.php) …that’s the least of my worries.

    The wordpress user interface on the admin panel at “>Appearance>Menus>” is based on a hierarchical model …designed for the typical drop-down menu where the menu items are hierarchical. A Mega Menu or multi-column menu does not use that hierarchical model. Instead the menu entries (or “links”) are arranged in columns or in some other visually logical order.

    Some people are using the “css Classes” text entry box in the menus interface to give the end user a way of specifying that a specific menu entry should appear in a Mega Menu (and it would probably be possible to code a way for users to specify where in the multi-column menu this particular entry should appear).

    I was just fishing around to see if anyone had any best-practice advice on how to implement this – from a high-level perspective. The basic problem is that non-technical users need a way of specifying how they want the menu entries to appear in the multi-column (non-hierarchical) menu. Mega Menu plugins give users an interface (sometimes a very complex interface) to enable many, many users with many, many differing requirements to do this. I’m looking for suggestions on how to give non-technical users minimal, rudimentary control over where specific menu items appear in a multi-column menu – whether the actual implementation in code is via the “css Classes” entry box or via some other method.

    -Patrick

    Moderator bcworkz

    (@bcworkz)

    WP_Nav_Walker basically just follows the hierarchy established by the admin interface’s menu tree. If it were fed a series of top level items (“column” containers) with a list of immediate children with no deeper descendants, I imagine it will generate the structure you speak of. It’s still up to the theme to display it correctly. It seems to me the issue is more with how the menu items are defined than the walker itself. Having end users type in CSS classes would not be helpful for your non-technical users.

    Maybe it would helpful to study existing plugins source code and use the elements you find useful as guidance for your own efforts.

    Yes, I’m aware that walker follows the hierarchy established by the admin interface’s menu tree and yes I’m aware that its up to the theme to display it correctly.

    People are creating these multi-column menus. They are common. I’m looking for input from people who have experience doing it with wordpress (ie: using the user interface in some way; not just hard-coding it in code – I know how to do that) or who might have input on how existing functionality in wordpress code is intended to be used to get this result.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.