protected virtual string GetViewForPageType(PageData currentPage) { var virtualPath = String.Format("~/Views/{0}/Index.cshtml", currentPage.GetOriginalType().Name); if (System.IO.File.Exists(Request.MapPath(virtualPath)) == false) { virtualPath = "Index"; } return(virtualPath); }
public ViewResult Index(PageData currentPage) { var virtualPath = String.Format("~/Views/{0}/Index.cshtml", currentPage.GetOriginalType().Name); if (System.IO.File.Exists(Request.MapPath(virtualPath)) == false) { virtualPath = "Index"; } var model = CreatePageViewModel(currentPage); var editHints = ViewData.GetEditHints <Chrome, HomePage>(); editHints.AddConnection(c => c.GlobalFooterContent, p => p.GlobalFooterContent); // Since we're handling the logo property a bit different (url comes from view model) // we need to refresh the page when it changes. // editHints.AddFullRefreshFor(c => c.LogoImage); return(View(virtualPath, model)); }