-2

I have added a menu to a block in a full width region but my problem is that this menu appears vertical and I didn't find a way in Drupal to make it horizontal, similar in style and behavior to a main navigation menu.

I don't want to develop CSS to make the menu horizontal and responsive and leveled from scratch if I can somehow do it with Drupal so it would be styled and behave more or less like the main navigation menu of my core theme Olivero or possibly of another core theme like Stark or Classy or Stable; I assume that I might indeed be able to somehow apply the exact same class system of some main navigation menu for that menu in a single quick action and voilà! the menu will become horizontal and responsive and leveled.
By "leveled" I mean that each menu item can have at least one menu-item-child.

Is there a Drupal way to make a menu horizontal and responsive and leveled (similar in style and behavior to a main navigation menu)?

1 Answer 1

0

Unfortunately it is not as simple as adding one single class and everything is automagically responsive and collapsable. It is definitely possible, and Olivero's main menu is a great template, but you can't duplicate it without writing your own custom CSS and JS (or PHP preprocessing).

You might get some no-code solutions from contrib modules though, try goolging for e.g. "drupal mega menu".

2
  • If I am not mistaken, the vertical menus in Bartik and Olivero are theme-agnostic CSSwise (they have some Drupal internal styling independent of a theme), hence, some version-agnostic styling to make Drupal vertical menus horizontal should apply to both. Have you ever came across anything like that?
    – drupaler
    Jan 19 at 14:11
  • Differtent things. Vertical menus are easy, they don't need to be responsive. Horizontal menus are basically broken if they aren't responsive. On top of that Oliveros's mainnav is sticky, has limited screenspace (and a custom logic if that space is overflown), has a "scroll down" behavior... much more complexity and goodies built in there.
    – Hudri
    Jan 19 at 14:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.