Orchard Menu Item Class

161 views Asked by At

I'm trying to add a menu item Css Class for navigation items, I found this answer on this site which looked promising (Orchard 1.5 add class or ID in ContentMenuItem) but doesn't seem to work now in version 1.9.2). (code from link shown below)

if (Model.CssClass != null) {
    tag.AddCssClass(Model.ContentItem.Menu.CssClass.Value);
}

I have tried that code but looking through the shape tracing tool and can find the value and try to perform the if statement and get a "Cannot perform runtime binding on a null reference".

0

There are 0 answers