mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixed that default layout data would not be applied.
This fixes the issue where the default layout data string would not be applied when creating new content items of a content type with the LayoutPart attached. For example, creating new Form content items would start out with an empty canvas instead of with a default Form element and a submit button.
This commit is contained in:
@@ -11,6 +11,7 @@ using Orchard.Layouts.Framework.Elements;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Layouts.Models;
|
||||
using Orchard.Layouts.Services;
|
||||
using Orchard.Layouts.Settings;
|
||||
using Orchard.Layouts.ViewModels;
|
||||
using Orchard.Logging;
|
||||
|
||||
@@ -89,6 +90,11 @@ namespace Orchard.Layouts.Drivers {
|
||||
|
||||
protected override DriverResult Editor(LayoutPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
return ContentShape("Parts_Layout_Edit", () => {
|
||||
if (part.Id == 0) {
|
||||
var settings = part.TypePartDefinition.Settings.GetModel<LayoutTypePartSettings>();
|
||||
part.LayoutData = settings.DefaultLayoutData;
|
||||
}
|
||||
|
||||
var viewModel = new LayoutPartViewModel {
|
||||
LayoutEditor = _layoutEditorFactory.Create(part)
|
||||
};
|
||||
|
Reference in New Issue
Block a user