public virtual IEnumerable <IFooterEntryViewModel> MapFooterItems(List <Footer> footer, Guid?parentId = null) { return(footer.Where(x => x.ParentId == parentId && C1Helper.IsUrlPagePublished(x.Url)).OrderBy(el => el.Order).Select(li => new FooterEntryViewModel() { DisplayName = li.DisplayName, Url = _analyticsNavigationUrlHelper.BuildUrl(li, footer, GoogleAnalyticsNavigationUrlProvider.MenuOrigin.Footer), CssClass = C1Helper.GetCssStyleValue(li.CssStyle), UrlTarget = C1Helper.GetUrlTargetValue(li.Target), Children = MapFooterItems(footer, li.Id) }).ToList()); }
public virtual IEnumerable <IMenuEntryViewModel> MapMainMenuItems(List <MainMenu> mainMenuItems, Guid?parentId = null) { return(mainMenuItems .Where(x => x.ParentId == parentId && C1Helper.IsUrlPagePublished(x.Url)) .OrderBy(el => el.Order) .Select(li => new HomeMainMenuEntryViewModel() { DisplayName = li.DisplayName, Url = _analyticsNavigationUrlHelper.BuildUrl(li, mainMenuItems, GoogleAnalyticsNavigationUrlProvider.MenuOrigin.Dropdown), Image = MapNavigationImage(GetNavigationImage(li.Id, new CultureInfo(li.SourceCultureName))), CssClass = C1Helper.GetCssStyleValue(li.CssStyle), UrlTarget = C1Helper.GetUrlTargetValue(li.Target), Children = MapMainMenuItems(mainMenuItems, li.Id), MenuType = MenuTypeEnum.Principal }).ToList()); }