I was looking to add a class to the ul for menu-main. I copied the menu.cshtml from the Navigation views to my theme, and was expecting to find the ul, but rather found that the ul is inserted with Tag.StartElement, with the Tag class being created
from the menu object:
// Model is Model.Menu from the layout (Layout.Menu)
var tag = Tag(Model, "ul");
<nav id="main-menu" class="main-menu no-mobile">
After some poking around, I found that the classes are retrieved from the class passed into the Tag constructor, so I could achieve what I wanted with:
but modifying the model within the view seems rather un-MVC.
Is there a cleaner way to add a class to this tag? I feel like I'm missing something.