예제 #1
0
        public ActionResult Container()
        {
            SidebarContainerViewModel model = new SidebarContainerViewModel();

            try
            {
                IPage page = pageAccessor.GetCurrentPage(HttpContext);

                model.HeaderProjections = new PageProjectionsViewModel
                    {
                        Page = page,
                        Projections = modulesRegistration.GetSidebarHeaderProjections().OrderBy(f => f.Order)
                    };

                model.SideProjections = new PageProjectionsViewModel
                    {
                        Page = page,
                        Projections = modulesRegistration.GetSidebarSideProjections().OrderBy(f => f.Order)
                    };

                model.BodyProjections = new PageProjectionsViewModel
                    {
                        Page = page,
                        Projections = modulesRegistration.GetSidebarBodyProjections().OrderBy(f => f.Order)
                    };

                model.Version = cmsHost.Version;
            }
            catch (CmsException ex)
            {
                Log.Error(ex);
            }

            return PartialView(model);
        }
예제 #2
0
        public ActionResult Container(RenderPageViewModel renderPageViewModel)
        {
            var modelToRender = renderPageViewModel.RenderingPage ?? renderPageViewModel;
            SidebarContainerViewModel model = new SidebarContainerViewModel();

            try
            {
                model.HeaderProjections = new PageProjectionsViewModel
                    {
                        Page = modelToRender,
                        Projections = modulesRegistration.GetSidebarHeaderProjections().OrderBy(f => f.Order)
                    };

                model.SideProjections = new PageProjectionsViewModel
                    {
                        Page = modelToRender,
                        Projections = modulesRegistration.GetSidebarSideProjections().OrderBy(f => f.Order)
                    };

                model.BodyProjections = new PageProjectionsViewModel
                    {
                        Page = modelToRender,
                        Projections = modulesRegistration.GetSidebarBodyProjections().OrderBy(f => f.Order)
                    };

                model.Version = configuration.Version;
            }
            catch (CoreException ex)
            {
                Log.Error(ex);
            }                       

            return PartialView(model);
        }