mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Store default location for Blog part in initial settings
--HG-- branch : dev
This commit is contained in:
parent
1f35d57933
commit
e1e48015a8
@ -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 {
|
||||
public class BlogsDataMigration : DataMigrationImpl {
|
||||
@ -22,5 +27,14 @@ namespace Orchard.Blogs.DataMigrations {
|
||||
|
||||
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) {
|
||||
var location = blog.GetLocation("Editor", "primary", "1");
|
||||
var location = blog.GetLocation("Editor");
|
||||
return Combined(
|
||||
ContentItemTemplate("Items/Blogs.Blog"),
|
||||
ContentPartTemplate(blog, "Parts/Blogs.Blog.Fields").Location(location));
|
||||
|
Loading…
Reference in New Issue
Block a user