mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Revived default layout data initialization.
This commit is contained in:
@@ -10,6 +10,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;
|
||||
|
||||
namespace Orchard.Layouts.Drivers {
|
||||
@@ -63,6 +64,11 @@ namespace Orchard.Layouts.Drivers {
|
||||
|
||||
protected override DriverResult Editor(LayoutPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
return ContentShape("Parts_Layout_Edit", () => {
|
||||
|
||||
if (part.Id == 0 && String.IsNullOrWhiteSpace(part.LayoutData)) {
|
||||
part.LayoutData = part.TypePartDefinition.Settings.GetModel<LayoutTypePartSettings>().DefaultLayoutData;
|
||||
}
|
||||
|
||||
var viewModel = new LayoutPartViewModel {
|
||||
LayoutEditor = _layoutEditorFactory.Create(part)
|
||||
};
|
||||
|
Reference in New Issue
Block a user