mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Differentiator is ignored processing placement
In placement files shapeType uses "__" intead of '-' char for declaring a differenciator. The point is second one is used only in template files as can be seen in documentation http://docs.orchardproject.net/Documentation/Accessing-and-rendering-shapes#NamingShapesandTemplates However GetShapeType looks for '-' character ignoring placements for a ShapeType with a differentiator. This produces strange behaviors and a lot of headaches to users because when they set for example: <Place Fields_Common_Text__SeoTitle="/Header:0"/> in a placement file it forces all Fields_Common_Text shapes within the same Match to be rendered at Header:0 area instead of only affecting those with the SeoTitle differentiator.
This commit is contained in:
@@ -111,8 +111,9 @@ namespace Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy {
|
||||
differentiator = "";
|
||||
shapeType = shapeLocation.ShapeType;
|
||||
var dashIndex = shapeType.LastIndexOf('-');
|
||||
if (dashIndex > 0 && dashIndex < shapeType.Length - 1) {
|
||||
differentiator = shapeType.Substring(dashIndex + 1);
|
||||
var dashIndex = shapeType.LastIndexOf("__");
|
||||
if (dashIndex > 0 && dashIndex < shapeType.Length - 2) {
|
||||
differentiator = shapeType.Substring(dashIndex + 2);
|
||||
shapeType = shapeType.Substring(0, dashIndex);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user