mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-19 17:51:45 +08:00
Generalize content location settings
We have multiple types of "display" ("Detail", "Summary", "Editor", etc.).
The Location settings now exposes 4 pre-defined display types for location
settings for Field and for Parts:
* Detail
* Editor
* Summary
* SummaryAdmin
--HG--
branch : dev
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentManagement.MetaData.Builders;
|
||||
using Orchard.Core.Routable.Models;
|
||||
using Orchard.Data.Migration;
|
||||
@@ -20,7 +22,9 @@ namespace Orchard.Core.Routable.DataMigrations {
|
||||
|
||||
public int UpdateFrom1() {
|
||||
ContentDefinitionManager.AlterPartDefinition(typeof(IsRoutable).Name, cfg => cfg
|
||||
.WithLocation("EditorLocation", "primary", "before.5"));
|
||||
.WithLocation(new Dictionary<string, ContentLocation> {
|
||||
{"Editor", new ContentLocation { Zone = "primary", Position = "before.5" }}
|
||||
} ));
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Common.Settings;
|
||||
using Orchard.Core.Routable.Models;
|
||||
using Orchard.Core.Routable.Services;
|
||||
@@ -67,8 +68,8 @@ namespace Orchard.Core.Routable.Drivers {
|
||||
: "";
|
||||
}
|
||||
|
||||
var locationSettings = part.PartDefinition.Settings.GetModel<LocationSettings>("EditorLocation");
|
||||
return ContentPartTemplate(model, TemplateName, Prefix).Location(locationSettings.Zone, locationSettings.Position);
|
||||
var location = part.PartDefinition.Settings.GetModel<LocationSettings>().Get("Editor");
|
||||
return ContentPartTemplate(model, TemplateName, Prefix).Location(location.Zone, location.Position);
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(IsRoutable part, IUpdateModel updater) {
|
||||
|
||||
Reference in New Issue
Block a user