i started working with drupal 8 few days ago.
I am working on theming with Twig.
I included the main Navigation on the header, after the activation of twig debug mode , i followed the suggestion of twig and i created menu-main.html.twig contains the html respresentation of the links and i had this display:
enter image description here
My Problem is :
I included the Main navigation on the footer too but it appears the same way as the header but i want to change the display to be like this:
enter image description here
What should i do ?

  • Add the main menu block to different regions. Then style accordingly based on region class specificity. This isn't exactly what you asked for, and it's my opinion on how I would build a maintainable Drupal web site.
    – mradcliffe
    Commented Apr 6, 2016 at 13:40
  • the problem is , i already created a twig file that define the menu (not the default one on /templates/navigation/menu.html.twig so the <ul> an <li> tags take the css class definied under that file Commented Apr 6, 2016 at 13:56
  • You can change it back?
    – mradcliffe
    Commented Apr 6, 2016 at 14:16
  • Yes i can but it will change the display of the menus on the header Commented Apr 6, 2016 at 14:34

1 Answer 1


Don't rely on a hardcoded class in your overridden template to style the menu, but instead rely on a container to style it (for example the containing block or region).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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