public async Task <IViewComponentResult> InvokeAsync() { dynamic model = ViewData.Model; if (model == null) { //TODO: return Context.PageMode.IsExperienceEditor ? this.InfoMessage(new InfoMessage(DictionaryRepository.Get("/navigation/linkmenu/noitems", "This menu has no items."), InfoMessage.MessageType.Warning)) : null; return(null); } var pageId = ViewBag.Page.ItemID; var rootnav = await _navigationRepository.GetNavigationRoot((Guid)model.ItemID); if (rootnav == null) { return(null); } var items = await _navigationRepository.GetLinkMenuItems(rootnav, (Guid)pageId); if (items == null) { return(null); } return(View("LinkMenu", await Task.WhenAll(items))); }
public ActionResult SocialMenu() { //if (string.IsNullOrEmpty(RenderingContext.Current.Rendering.DataSource)) //{ // return Context.PageMode.IsExperienceEditor ? this.InfoMessage(new InfoMessage(DictionaryRepository.Get("/navigation/linkmenu/noitems", "This menu has no items."), InfoMessage.MessageType.Warning)) : null; //} var item = RenderingContext.Current.Rendering.Item; var items = _navigationRepository.GetLinkMenuItems(item); return(View("SocialMenu", items)); }
public ActionResult LinkMenu() { if (string.IsNullOrEmpty(RenderingContext.Current.Rendering.DataSource)) { return(Context.PageMode.IsExperienceEditor ? this.InfoMessage(new InfoMessage(DictionaryPhraseRepository.Current.Get("/Navigation/Link Menu/No Items", "This menu has no items."), InfoMessage.MessageType.Warning)) : null); } var item = RenderingContext.Current.Rendering.Item; var items = _navigationRepository.GetLinkMenuItems(item); return(View("LinkMenu", items)); }
public ActionResult NavigationLinks() { if (string.IsNullOrEmpty(RenderingContext.Current.Rendering.DataSource)) { return(null); } var item = RenderingContext.Current.Rendering.Item; var items = _navigationRepository.GetLinkMenuItems(item); return(View("NavigationLinks", items)); }
public async Task <IViewComponentResult> InvokeAsync() { dynamic model = ViewData.Model; if (model == null) { return(null); } var rootnav = await _navigationRepository.GetNavigationRoot((Guid)model.ItemID); if (rootnav == null) { return(null); } var items = await _navigationRepository.GetLinkMenuItems(rootnav, (Guid)model.ItemID); if (items == null) { return(null); } return(View("NavigationLinks", await Task.WhenAll(items))); }