mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Store default location for BodyAspect part in initial settings
--HG-- branch : dev
This commit is contained in:
parent
a444c093a9
commit
bd54496d57
@ -1,4 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentManagement.MetaData.Builders;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Data.Migration;
|
||||
|
||||
namespace Orchard.Core.Common.DataMigrations {
|
||||
@ -31,5 +36,13 @@ namespace Orchard.Core.Common.DataMigrations {
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
ContentDefinitionManager.AlterPartDefinition(typeof(BodyAspect).Name, cfg => cfg
|
||||
.WithLocation(new Dictionary<string, ContentLocation> {
|
||||
{"Default", new ContentLocation { Zone = "primary", Position = "5" }},
|
||||
}));
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
@ -28,7 +28,7 @@ namespace Orchard.Core.Common.Drivers {
|
||||
// \/\/ Hackalicious on many accounts - don't copy what has been done here for the wrapper \/\/
|
||||
protected override DriverResult Display(BodyAspect part, string displayType) {
|
||||
var model = new BodyDisplayViewModel { BodyAspect = part, Text = BbcodeReplace(part.Text) };
|
||||
var location = part.GetLocation(displayType, "primary", "5");
|
||||
var location = part.GetLocation(displayType);
|
||||
|
||||
return Combined(
|
||||
Services.Authorizer.Authorize(Permissions.ChangeOwner) ? ContentPartTemplate(model, "Parts/Common.Body.ManageWrapperPre").LongestMatch(displayType, "SummaryAdmin").Location(location) : null,
|
||||
@ -39,7 +39,7 @@ namespace Orchard.Core.Common.Drivers {
|
||||
|
||||
protected override DriverResult Editor(BodyAspect part) {
|
||||
var model = BuildEditorViewModel(part);
|
||||
var location = part.GetLocation("Editor", "primary", "5");
|
||||
var location = part.GetLocation("Editor");
|
||||
return ContentPartTemplate(model, TemplateName, Prefix).Location(location);
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ namespace Orchard.Core.Common.Drivers {
|
||||
if (string.IsNullOrWhiteSpace(model.Format))
|
||||
model.Format = GetFlavor(part);
|
||||
|
||||
var location = part.GetLocation("Editor", "primary", "5");
|
||||
var location = part.GetLocation("Editor");
|
||||
return ContentPartTemplate(model, TemplateName, Prefix).Location(location);
|
||||
}
|
||||
|
||||
|
@ -8,5 +8,5 @@ description: The common module introduces content parts that are going to be use
|
||||
features:
|
||||
Common:
|
||||
Description: Core content parts.
|
||||
Dependencies: ContentsLocation
|
||||
Dependencies: Settings
|
||||
Category: Core
|
||||
|
@ -9,4 +9,4 @@ features:
|
||||
PublishLater:
|
||||
Description: Draft creation and scheduled publishing.
|
||||
Category: Content
|
||||
Dependencies: Common
|
||||
Dependencies: Common, Settings
|
||||
|
@ -8,5 +8,5 @@ description: The routable module enables content items to be accessed through a
|
||||
features:
|
||||
Routable:
|
||||
Description: Routable content part.
|
||||
Dependencies: ContentsLocation
|
||||
Dependencies: Settings
|
||||
Category: Core
|
||||
|
Loading…
Reference in New Issue
Block a user