Overriding 'Menu' class in theme

Topics: Writing themes
Feb 12, 2012 at 3:25 PM
Edited Feb 12, 2012 at 3:30 PM

In my custom theme I have an alternate for 'Menu.cshtml' (MyTheme/Views/Menu.cshtml) where I am trying to override (or add to) the class "menu menu-main" applied to the navigation menu.

I have tried adding: 

Model.Classes.Add("nav");

But the menu still gets rendered as:

 

<ul class="menu menu-main" shape-id="5">
<li class="active" shape-id="6">
<a href="/OrchardDev/" shape-id="6">Home</a>
</li>
</ul>

 

How do I inject or override this class to end up with:

 

<ul class="nav" shape-id="5">
<li class="active" shape-id="6">
<a href="/OrchardDev/" shape-id="6">Home</a>
</li>
</ul>

FIXED!

I had put the Model.Classes.Add("nav") after the var tag=Tag(Model, "ul") instead of before it!

My mistake!!