Update Routable part to use settings for Display/Editor locations

--HG--
branch : dev
This commit is contained in:
Renaud Paquay 2010-07-20 19:38:56 -07:00
parent 829e7cdb3a
commit 2ffe3f7073
3 changed files with 15 additions and 2 deletions

View File

@ -1,4 +1,7 @@
using Orchard.Data.Migration;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.Core.Routable.Models;
using Orchard.Data.Migration;
namespace Orchard.Core.Routable.DataMigrations {
public class RoutableDataMigration : DataMigrationImpl {
@ -14,5 +17,12 @@ namespace Orchard.Core.Routable.DataMigrations {
return 1;
}
public int UpdateFrom1() {
ContentDefinitionManager.AlterPartDefinition(typeof(IsRoutable).Name, cfg => cfg
.WithLocation("EditorLocation", "primary", "before.5"));
return 2;
}
}
}

View File

@ -1,6 +1,7 @@
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.ContentManagement.Drivers;
using Orchard.Core.Common.Settings;
using Orchard.Core.Routable.Models;
using Orchard.Core.Routable.Services;
using Orchard.Core.Routable.ViewModels;
@ -66,7 +67,8 @@ namespace Orchard.Core.Routable.Drivers {
: "";
}
return ContentPartTemplate(model, TemplateName, Prefix).Location("primary", "before.5");
var locationSettings = part.PartDefinition.Settings.GetModel<LocationSettings>("EditorLocation");
return ContentPartTemplate(model, TemplateName, Prefix).Location(locationSettings.Zone, locationSettings.Position);
}
protected override DriverResult Editor(IsRoutable part, IUpdateModel updater) {

View File

@ -8,4 +8,5 @@ description: The routable module enables content items to be accessed through a
features:
Routable:
Description: Routable content part.
Dependencies: Settings
Category: Core