Store default location for Blog part in initial settings

--HG--
branch : dev
This commit is contained in:
Renaud Paquay 2010-07-21 17:59:17 -07:00
parent 1f35d57933
commit e1e48015a8
2 changed files with 16 additions and 2 deletions

View File

@ -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;
}
}
}

View File

@ -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));