Add region modifier class to menu
I asked this in the DrupalTwig slack channel a couple days ago:
I’m trying to figure out how to allow for different menu styles depending upon which region a menu is placed in. Has anyone run into this issue?
I already have my 3 menu markup/styles in PatternLab and I just need to figure out how to do the Drupal side
Here’s what I came up with to resolve my issue. It is definitely far from flawless. I will try to continue to improve it, but here it is for now. Please let me know if you have a better way to add a modifier class to menus based upon the region they are placed in.
It would be much more ideal to have a region variable in menu.html.twig.
Sources
Written on January 9, 2017