mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-18 17:47:54 +08:00
Store default location for Blog part in initial settings
--HG-- branch : dev
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
using Orchard.Data.Migration;
|
using System.Collections.Generic;
|
||||||
|
using Orchard.Blogs.Models;
|
||||||
|
using Orchard.ContentManagement.Drivers;
|
||||||
|
using Orchard.ContentManagement.MetaData;
|
||||||
|
using Orchard.ContentManagement.MetaData.Builders;
|
||||||
|
using Orchard.Data.Migration;
|
||||||
|
|
||||||
namespace Orchard.Blogs.DataMigrations {
|
namespace Orchard.Blogs.DataMigrations {
|
||||||
public class BlogsDataMigration : DataMigrationImpl {
|
public class BlogsDataMigration : DataMigrationImpl {
|
||||||
@@ -22,5 +27,14 @@ namespace Orchard.Blogs.DataMigrations {
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int UpdateFrom1() {
|
||||||
|
ContentDefinitionManager.AlterPartDefinition(typeof(Blog).Name, cfg => cfg
|
||||||
|
.WithLocation(new Dictionary<string, ContentLocation> {
|
||||||
|
{"Editor", new ContentLocation { Zone = "primary", Position = "1" }}
|
||||||
|
}));
|
||||||
|
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -94,7 +94,7 @@ namespace Orchard.Blogs.Drivers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(Blog blog) {
|
protected override DriverResult Editor(Blog blog) {
|
||||||
var location = blog.GetLocation("Editor", "primary", "1");
|
var location = blog.GetLocation("Editor");
|
||||||
return Combined(
|
return Combined(
|
||||||
ContentItemTemplate("Items/Blogs.Blog"),
|
ContentItemTemplate("Items/Blogs.Blog"),
|
||||||
ContentPartTemplate(blog, "Parts/Blogs.Blog.Fields").Location(location));
|
ContentPartTemplate(blog, "Parts/Blogs.Blog.Fields").Location(location));
|
||||||
|
Reference in New Issue
Block a user