From 2695ee6db7444d2d3795312d743cccf54c4f4fd7 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Fri, 21 Sep 2012 15:25:09 -0700 Subject: [PATCH] #18867: Rendering CustomForm title Work Item: 18867 --HG-- branch : 1.x --- .../Orchard.CustomForms/Controllers/ItemController.cs | 2 +- .../Modules/Orchard.CustomForms/Views/Item/Create.cshtml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.CustomForms/Controllers/ItemController.cs b/src/Orchard.Web/Modules/Orchard.CustomForms/Controllers/ItemController.cs index 4d4f09f09..0750cdef5 100644 --- a/src/Orchard.Web/Modules/Orchard.CustomForms/Controllers/ItemController.cs +++ b/src/Orchard.Web/Modules/Orchard.CustomForms/Controllers/ItemController.cs @@ -67,7 +67,7 @@ namespace Orchard.CustomForms.Controllers { dynamic model = _contentManager.BuildEditor(contentItem); model - .ContenItem(form) + .ContentItem(form) .ReturnUrl(Url.RouteUrl(_contentManager.GetItemMetadata(form).DisplayRouteValues)); // Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation. diff --git a/src/Orchard.Web/Modules/Orchard.CustomForms/Views/Item/Create.cshtml b/src/Orchard.Web/Modules/Orchard.CustomForms/Views/Item/Create.cshtml index 06b418dc2..f917b46bd 100644 --- a/src/Orchard.Web/Modules/Orchard.CustomForms/Views/Item/Create.cshtml +++ b/src/Orchard.Web/Modules/Orchard.CustomForms/Views/Item/Create.cshtml @@ -2,11 +2,14 @@ @{ ContentItem customForm = Model.ContentItem; string returnUrl = Model.ReturnUrl; - + var titlePart = customForm.As(); + // remove default Save/Publish buttons Model.Zones["Sidebar"].Items.Clear(); } +@Display(New.Parts_Title().ContentPart(titlePart).Title(titlePart.Title)) + @using (Html.BeginFormAntiForgeryPost(returnUrl)) { @Html.ValidationSummary() // Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type