#18867: Rendering CustomForm title

Work Item: 18867

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-09-21 15:25:09 -07:00
parent 2ff809a32c
commit 2695ee6db7
2 changed files with 5 additions and 2 deletions

View File

@@ -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.

View File

@@ -2,11 +2,14 @@
@{
ContentItem customForm = Model.ContentItem;
string returnUrl = Model.ReturnUrl;
var titlePart = customForm.As<Orchard.Core.Title.Models.TitlePart>();
// 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