public ActionResult Index(string slug) { if (!string.IsNullOrEmpty(slug)) { var page = _pageService.GetBySlugs(slug); if (page != null) { return(View(page)); } } TempData["Message"] = "Page not found"; return(Redirect("/CmsHome/ResourceNotFound")); }
public ActionResult Index() { if (SetupHelper.IsDbCreateComplete && SetupHelper.IsAdminCreateComplete) { ViewBag.Content = ""; ViewBag.Layout = ""; var page = _pageService.GetBySlugs("Home"); if (page != null) { ViewBag.Content = page.Content; if (GlobalConfig.ActiveTheme.Layouts.Where(l => l.Name.Contains(page.Layout)).Count() > 0) { ViewBag.Layout = page.Layout; } } return(View()); } return(Redirect("/SetupHome/Index")); }