Umbraco 7 Partial View - Main Navigation - C# - Razor - With Home Page
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ var home = CurrentPage.Site(); } @if (home.Children.Any()) { @* Get the first page in the children *@ var naviLevel = home.Children.First().Level; @* Add in level for a CSS hook *@ @* For each child page under the home node *@ foreach (var childPage in home.Children) { if(childPage.umbracoNaviHide != true) { if (childPage.Children.Any()) { <li class="has-child @(childPage.IsAncestorOrSelf(CurrentPage) ? "current-menu-item page_item" : null)"> @if(childPage.DocumentTypeAlias == "LandingPage") { <a href="@childPage.Url">@childPage.navigationName</a> @childPages(childPage.Children) } else { ...