mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Update Routable part to use settings for Display/Editor locations
--HG-- branch : dev
This commit is contained in:
parent
829e7cdb3a
commit
2ffe3f7073
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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) {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user