예제 #1
0
        public ActionResult Index(string pageNames, string section)
        {
            string pagePath = "/" + section;

            if (!string.IsNullOrEmpty(pageNames))
            {
                foreach (string pageName in pageNames.Split('/'))
                {
                    if (pageName.Length > 0)
                    {
                        pagePath += "/" + pageName;
                    }
                }
            }

            pagePath += "/";

            var page = (from p in db.pages where p.pageURL.Equals(pagePath) select p).FirstOrDefault();

            if (page != null)
            {
                ViewData["page_title"] = page.pageTitle;
                ViewData["page_text"] = page.pageContent;
            }

            ViewData["pageURL"] = pagePath;

            Pages pages = new Pages("/" + section + "/");
            var navItems = pages.getPages();

            return View(navItems);
        }
예제 #2
0
        public PartialViewResult Navigation()
        {
            var rd = ControllerContext.ParentActionViewContext.RouteData;
            string currentController = rd.GetRequiredString("controller");

            Pages pages = new Pages(currentController);

            var navItems = pages.getNavigation();

            return PartialView(navItems);
        }
예제 #3
0
        public PartialViewResult Sidebar(string id)
        {
            string currentController = id;
            if (string.IsNullOrEmpty(id))
            {
                var rd = ControllerContext.ParentActionViewContext.RouteData;
                currentController = rd.GetRequiredString("controller");
            }
            Pages pages = new Pages("/" + currentController + "/");

            var navItems = pages.getPages();

            ViewData["pageURL"] = currentController;

            return PartialView(navItems);
        }
예제 #4
0
        public ActionResult PagePreview(int id)
        {
            var page = (from p in db.pages where p.pageID.Equals(id) select p).FirstOrDefault();

            var parentPage = (from p in db.pages where p.pageID == page.parent select p).FirstOrDefault();
            ViewData["pageheader"] = parentPage.pageTitle;

            if (page != null)
            {
                ViewData["page_title"] = page.pageTitle;
                ViewData["page_text"] = page.pageContent;
            }

            Pages pages = new Pages(parentPage.pageURL);
            var navItems = pages.getPages();

            return View(navItems);
        }