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)));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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)));
        }