mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18871: Fixing root zone placement
Work Item: 18871 --HG-- branch : 1.x
This commit is contained in:
@@ -74,6 +74,9 @@ namespace Orchard.ContentTypes.Services {
|
||||
itemShape.Metadata.DisplayType = actualDisplayType;
|
||||
|
||||
var context = new BuildDisplayContext(itemShape, content, actualDisplayType, String.Empty, _shapeFactory);
|
||||
var workContext = _workContextAccessor.GetContext(_requestContext.HttpContext);
|
||||
context.Layout = workContext.Layout;
|
||||
|
||||
BindPlacement(context, actualDisplayType, "Content");
|
||||
|
||||
var placementSettings = new List<DriverResultPlacement>();
|
||||
|
@@ -54,6 +54,9 @@ namespace Orchard.ContentManagement {
|
||||
itemShape.Metadata.DisplayType = actualDisplayType;
|
||||
|
||||
var context = new BuildDisplayContext(itemShape, content, actualDisplayType, groupId, _shapeFactory);
|
||||
var workContext = _workContextAccessor.GetContext(_requestContext.HttpContext);
|
||||
context.Layout = workContext.Layout;
|
||||
|
||||
BindPlacement(context, actualDisplayType, stereotype);
|
||||
|
||||
_handlers.Value.Invoke(handler => handler.BuildDisplay(context), Logger);
|
||||
|
@@ -73,6 +73,12 @@ namespace Orchard.ContentManagement.Drivers {
|
||||
newShapeMetadata.Wrappers.Add(wrapper);
|
||||
}
|
||||
|
||||
// the zone name is in reference of Layout, e.g. /AsideSecond
|
||||
if (placement.Location.StartsWith("/")) {
|
||||
placement.Location = placement.Location.Substring(1);
|
||||
parentShape = context.Layout;
|
||||
}
|
||||
|
||||
var delimiterIndex = placement.Location.IndexOf(':');
|
||||
if (delimiterIndex < 0) {
|
||||
parentShape.Zones[placement.Location].Add(newShape);
|
||||
|
@@ -17,6 +17,7 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
public IContent Content { get; private set; }
|
||||
public ContentItem ContentItem { get; private set; }
|
||||
public dynamic New { get; private set; }
|
||||
public IShape Layout { get; set; }
|
||||
public string GroupId { get; private set; }
|
||||
public ContentPart ContentPart { get; set; }
|
||||
|
||||
|
@@ -75,12 +75,6 @@ namespace Orchard.UI.Zones {
|
||||
if (keys.Count() == 1) {
|
||||
var key = System.Convert.ToString(keys.Single());
|
||||
|
||||
// the zone name is in reference of Layout, e.g. /AsideSecond
|
||||
if(_layoutShape != null && key.StartsWith("/")) {
|
||||
key = key.Substring(1);
|
||||
_parent = _layoutShape;
|
||||
}
|
||||
|
||||
return GetMember(proceed, null, key);
|
||||
}
|
||||
return proceed();
|
||||
|
Reference in New Issue
Block a user