public ActionResult PreviewPage(Guid id, bool import = false, Guid?importToCat = null, int o = 0, int c = 200)
        {
            PageViewModel viewModel = null;

            if (id == Guid.Empty)
            {
                viewModel = new PageViewModel {
                    Id   = Guid.Empty,
                    Name = StringResource.admin_HomeShort
                };
            }
            else
            {
                var page = this.repository.GetPageById(id);

                this.ViewData["ProductItemsViewModel"] =
                    CategoryViewModelFactory.CreateCategoryViewModel(this.HttpContext.CurrentUser(), page, c, o, ListingViewProductSettings.AdminSettings);

                if (page.IsCategory())
                {
                    var category = repository.GetCategoryById(page.CategoryId.Value);
                    this.ViewData["CategoryProducts"] = new CategoryProductsViewModel(this.repository, page.Id, o, c)
                    {
                        IsTiles = category.ListType == 2
                    };
                }

                viewModel = new PageViewModel(page, this.repository);
            }

            this.ViewData["IsImportMode"] = import;
            this.ViewData["importToCat"]  = importToCat;
            return(this.View(viewModel));
        }
        private ActionResult ContentPage(ContentPage page, Guid id, User user, int c, int o)
        {
            // Page/Category view
            this.ViewData["BreadcrumbViewModel"]     = MenuViewModelFactory.CreateBreadcrumb(repository, id);
            this.ViewData["NavigationMenuViewModel"] = MenuViewModelFactory.CreateNavigationMenu(repository, id, this.Request);

            var viewModel = new PageViewModel(page, this.repository);

            this.ViewData["ProductItemsViewModel"] = CategoryViewModelFactory.CreateCategoryViewModel(user, page, c, o, ListingViewProductSettings.User);

            this.ViewData["IsPage"] = !viewModel.ContentPage.IsCategory();
            return(this.View(viewModel));
        }