/// <inheritdoc/>
        protected override DataTemplate SelectTemplateCore(object item)
        {
            SitemapViewModel sitemapMenuItem = item as SitemapViewModel;

            if (sitemapMenuItem != null)
            {
                return(SiteMapMenuItemTemplate);
            }

            return(DefaultItemTemlate);
        }
Exemple #2
0
        // GET: Sitemap
        public override ActionResult Index()
        {
            Item homePage = Sitecore.Context.Database.GetItem(Sitecore.Context.Site.RootPath + Sitecore.Context.Site.StartItem);
            var  sitemap  = SitecoreHelper.GetItem <MenuItem>(homePage.ID.ToGuid());

            SitemapViewModel model = new SitemapViewModel()
            {
                SitemapNodes = sitemap
            };

            return(View("~/Views/Pages/Sitemap.cshtml", model));
        }
        public IActionResult Index()
        {
            var sitemapViewModel = new SitemapViewModel();

            var tags = _tagRepository.GetAllTags();

            foreach (var tag in tags)
            {
                sitemapViewModel.kategorier.Add(_tagRepository.GetKategoriAndPages(tag.Moniker));
            }

            sitemapViewModel.categories = _categoryRepository.GetAllCategorys().ToList();

            return(View(sitemapViewModel));
        }
Exemple #4
0
        public ActionResult SaveSitemap(SitemapViewModel model)
        {
            if (ModelState.IsValid)
            {
                model.UserAccessList = model.UserAccessList ?? new List <UserAccessViewModel>();
                var response = GetCommand <SaveSitemapCommand>().ExecuteCommand(model);
                if (response != null)
                {
                    if (model.Id.HasDefaultValue())
                    {
                        Messages.AddSuccess(NavigationGlobalization.Sitemap_SitemapCreatedSuccessfully_Message);
                    }

                    return(Json(new WireJson {
                        Success = true, Data = response
                    }));
                }
            }

            return(Json(new WireJson {
                Success = false
            }));
        }
        public override ActionResult Index(RenderModel model)
        {
            var SitemapModel = new SitemapViewModel(model.Content);

            return(CurrentTemplate(SitemapModel));
        }