diff --git a/src/Orchard/ContentManagement/DefaultContentDisplay.cs b/src/Orchard/ContentManagement/DefaultContentDisplay.cs index 44ee2fe89..cb03ce034 100644 --- a/src/Orchard/ContentManagement/DefaultContentDisplay.cs +++ b/src/Orchard/ContentManagement/DefaultContentDisplay.cs @@ -103,30 +103,13 @@ namespace Orchard.ContentManagement { ShapeDescriptor descriptor; if (shapeTable.Descriptors.TryGetValue(partShapeType, out descriptor)) { - ShapePlacementContext placementContext; - string location; - - // First, look up placement with differentiator - if (!string.IsNullOrEmpty(differentiator)) { - placementContext = new ShapePlacementContext { - ContentType = context.ContentItem.ContentType, - DisplayType = displayType, - Differentiator = differentiator, - }; - location = descriptor.Placement(placementContext); - if (!string.IsNullOrEmpty(location)) - return location; - } - - // Then fallback to placement without differentiator - placementContext = new ShapePlacementContext { + var placementContext = new ShapePlacementContext { ContentType = context.ContentItem.ContentType, DisplayType = displayType, - Differentiator = null, + Differentiator = differentiator, }; - location = descriptor.Placement(placementContext); - if (!string.IsNullOrEmpty(location)) - return location; + var location = descriptor.Placement(placementContext); + return location ?? defaultLocation; } return defaultLocation; }; diff --git a/src/Orchard/DisplayManagement/Descriptors/ShapePlacementStrategy/ShapePlacementParsingStrategy.cs b/src/Orchard/DisplayManagement/Descriptors/ShapePlacementStrategy/ShapePlacementParsingStrategy.cs index 36708f0be..b7761a785 100644 --- a/src/Orchard/DisplayManagement/Descriptors/ShapePlacementStrategy/ShapePlacementParsingStrategy.cs +++ b/src/Orchard/DisplayManagement/Descriptors/ShapePlacementStrategy/ShapePlacementParsingStrategy.cs @@ -58,7 +58,11 @@ namespace Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy { string differentiator; GetShapeType(shapeLocation, out shapeType, out differentiator); - Func predicate = ctx => (ctx.Differentiator ?? "") == differentiator; + Func predicate = ctx => true; + if (differentiator != "") { + predicate = ctx => (ctx.Differentiator ?? "") == differentiator; + } + if (matches.Any()) { predicate = matches.SelectMany(match => match.Terms).Aggregate(predicate, BuildPredicate); }