mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-18 19:51:45 +08:00
Update Routable part to use settings for Display/Editor locations
--HG-- branch : dev
This commit is contained in:
@@ -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 {
|
namespace Orchard.Core.Routable.DataMigrations {
|
||||||
public class RoutableDataMigration : DataMigrationImpl {
|
public class RoutableDataMigration : DataMigrationImpl {
|
||||||
@@ -14,5 +17,12 @@ namespace Orchard.Core.Routable.DataMigrations {
|
|||||||
|
|
||||||
return 1;
|
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;
|
||||||
using Orchard.ContentManagement.Aspects;
|
using Orchard.ContentManagement.Aspects;
|
||||||
using Orchard.ContentManagement.Drivers;
|
using Orchard.ContentManagement.Drivers;
|
||||||
|
using Orchard.Core.Common.Settings;
|
||||||
using Orchard.Core.Routable.Models;
|
using Orchard.Core.Routable.Models;
|
||||||
using Orchard.Core.Routable.Services;
|
using Orchard.Core.Routable.Services;
|
||||||
using Orchard.Core.Routable.ViewModels;
|
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) {
|
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:
|
features:
|
||||||
Routable:
|
Routable:
|
||||||
Description: Routable content part.
|
Description: Routable content part.
|
||||||
|
Dependencies: Settings
|
||||||
Category: Core
|
Category: Core
|
||||||
|
|||||||
Reference in New Issue
Block a user