2

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 Apr 6 '16 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 – Meher Jebali Apr 6 '16 at 13:56
  • You can change it back? – mradcliffe Apr 6 '16 at 14:16
  • Yes i can but it will change the display of the menus on the header – Meher Jebali Apr 6 '16 at 14:34
0

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).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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