mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Store default location for the "Common" part in initial settings
--HG-- branch : dev
This commit is contained in:
parent
95e1fd7114
commit
12c17cdccb
@ -44,5 +44,14 @@ namespace Orchard.Core.Common.DataMigrations {
|
||||
}));
|
||||
return 2;
|
||||
}
|
||||
|
||||
public int UpdateFrom2() {
|
||||
ContentDefinitionManager.AlterPartDefinition(typeof(CommonAspect).Name, cfg => cfg
|
||||
.WithLocation(new Dictionary<string, ContentLocation> {
|
||||
{"Default", new ContentLocation { Zone = "metadata", Position = "5" }},
|
||||
{"Editor", new ContentLocation { Zone = "primary", Position = "20" }},
|
||||
}));
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
}
|
@ -36,10 +36,9 @@ namespace Orchard.Core.Common.Drivers {
|
||||
public IOrchardServices Services { get; set; }
|
||||
|
||||
protected override DriverResult Display(CommonAspect part, string displayType) {
|
||||
var location = part.GetLocation(displayType, "metadata", "5");
|
||||
return ContentPartTemplate(new CommonMetadataViewModel(part), "Parts/Common.Metadata")
|
||||
.LongestMatch(displayType, "Summary", "SummaryAdmin")
|
||||
.Location(location);
|
||||
.Location(part.GetLocation(displayType));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(CommonAspect part) {
|
||||
@ -83,8 +82,7 @@ namespace Orchard.Core.Common.Drivers {
|
||||
}
|
||||
}
|
||||
|
||||
var location = part.GetLocation("Editor", "primary", "20");
|
||||
return ContentPartTemplate(model, "Parts/Common.Owner", TemplatePrefix).Location(location);
|
||||
return ContentPartTemplate(model, "Parts/Common.Owner", TemplatePrefix).Location(part.GetLocation("Editor"));
|
||||
}
|
||||
|
||||
DriverResult ContainerEditor(CommonAspect part, IUpdateModel updater) {
|
||||
@ -112,8 +110,7 @@ namespace Orchard.Core.Common.Drivers {
|
||||
}
|
||||
}
|
||||
|
||||
var location = part.GetLocation("Editor", "primary", "20.1");
|
||||
return ContentPartTemplate(model, "Parts/Common.Container", TemplatePrefix).Location(location);
|
||||
return ContentPartTemplate(model, "Parts/Common.Container", TemplatePrefix).Location(part.GetLocation("Editor"));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user