mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge pull request #5433 from jersiovic/patch-3
Issue #5432 Differentiator is ignored processing placement
This commit is contained in:
+11
-3
@@ -110,10 +110,18 @@ namespace Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy {
|
|||||||
private void GetShapeType(PlacementShapeLocation shapeLocation, out string shapeType, out string differentiator) {
|
private void GetShapeType(PlacementShapeLocation shapeLocation, out string shapeType, out string differentiator) {
|
||||||
differentiator = "";
|
differentiator = "";
|
||||||
shapeType = shapeLocation.ShapeType;
|
shapeType = shapeLocation.ShapeType;
|
||||||
|
var separatorLengh = 2;
|
||||||
|
var separatorIndex = shapeType.LastIndexOf("__");
|
||||||
|
|
||||||
var dashIndex = shapeType.LastIndexOf('-');
|
var dashIndex = shapeType.LastIndexOf('-');
|
||||||
if (dashIndex > 0 && dashIndex < shapeType.Length - 1) {
|
if (dashIndex > separatorIndex) {
|
||||||
differentiator = shapeType.Substring(dashIndex + 1);
|
separatorIndex = dashIndex;
|
||||||
shapeType = shapeType.Substring(0, dashIndex);
|
separatorLengh = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (separatorIndex > 0 && separatorIndex < shapeType.Length - separatorLengh) {
|
||||||
|
differentiator = shapeType.Substring(separatorIndex + separatorLengh);
|
||||||
|
shapeType = shapeType.Substring(0, separatorIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user