Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
@{ var rootPages = Umbraco.ContentAtRoot().Where("showOnPrimaryNavigation = true"); if (rootPages.Count() != 0) { <ul class="nav navbar-nav navbar-right"> @foreach (var rootPage in rootPages) { <li class="@(CurrentPage.IsAncestorOrSelf(Model) ? "active" : null)"> <a href="@rootPage.Url">@rootPage.navigationText</a> </li> } </ul> } }
Welcome to Our!
How about this?
<li class="@(rootPage.IsAncestorOrSelf(CurrentPage) ? "active" : null)">
Thanks man, that did the trick!!!
Awesome!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How do I add an active class to my <li> when the current page is active?
Welcome to Our!
How about this?
Thanks man, that did the trick!!!
Awesome!
is working on a reply...