November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Here's the navigation view code I have currently...
@using EPiServer.Core @using EPiServer @using EPiServer.Filters @using epiSalesDemo.Helpers @using EPiServer.Web.Mvc.Html @using EPiServer.ServiceLocation @using EPiServer.SpecializedProperties @using EPiServer.Web.Routing @using epiSalesDemo.Models.Pages @{ var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>(); var mainNavRef = contentLoader.GetChildren<PageData>(ContentReference.StartPage); var home = contentLoader.Get<HomePage>(ContentReference.StartPage); PageData sp = DataFactory.Instance.GetPage(PageReference.StartPage); bool showSecondLevelNavigation = true; bool showThirdLevelNavigation = false; PageRouteHelper pageRouteHelper = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<PageRouteHelper>(); PageData currentPage = pageRouteHelper.Page; PageData parentPage = DataFactory.Instance.GetPage(currentPage.ParentLink); } <nav> <ul class="clearfix main-nav"> @{ IEnumerable<IContent> SubNav = new PageDataCollection(); IEnumerable<IContent> ThirdNav = new PageDataCollection(); foreach (PageData topLevelPage in mainNavRef) { if (topLevelPage.HasTemplate() && topLevelPage.VisibleInMenu && topLevelPage.IsVisibleOnSite()) { bool IsCurrentPage = false; if (topLevelPage.ContentGuid == parentPage.ContentGuid) { IsCurrentPage = true; } IsCurrentPage = currentPage.PageGuid == topLevelPage.PageGuid || IsCurrentPage; @:<li class="@(IsCurrentPage ? "highlight" : "")">@Html.PageLink(topLevelPage) SubNav = contentLoader.GetChildren<PageData>(topLevelPage.ContentLink); bool weHaveSubPages = false; foreach (PageData subPage in SubNav) { if (subPage.HasTemplate() && subPage.VisibleInMenu && subPage.IsVisibleOnSite()) { weHaveSubPages = true; } } if (weHaveSubPages && showSecondLevelNavigation) { @:<div class="nav-sub clearfix"><div class="large-6 column"><ul> foreach (PageData subPage in SubNav) { if (subPage.HasTemplate() && subPage.VisibleInMenu && subPage.IsVisibleOnSite()) { @:<li>@Html.PageLink(subPage)</li> } } @:</ul></div> @:<div class="large-6 show-for-large-up column"> DISPLAY CUSTOM CONTENT FROM MAIN NAV PAGE HERE @:</div></div> } @:</li> } } } </ul> </nav>
I want to have unique content for each drop down in my main navigation. So for each main nav item's drop down, you'd have a list of pages under that page (got that part) but then you'd also have custom content for that main nav item, like an image or anything else that would go in a Xhtmlstring Editor.
Any ideas?