diff --git a/src/Orchard.Web/Core/Shapes/CoreShapes.cs b/src/Orchard.Web/Core/Shapes/CoreShapes.cs
index be95189eb..c1260411e 100644
--- a/src/Orchard.Web/Core/Shapes/CoreShapes.cs
+++ b/src/Orchard.Web/Core/Shapes/CoreShapes.cs
@@ -301,9 +301,12 @@ namespace Orchard.Core.Shapes {
var progress = 1;
var flatPositionComparer = new FlatPositionComparer();
var ordering = unordered.Select(item => {
- var position = (item == null || item.GetType().GetProperty("Metadata") == null || item.Metadata.GetType().GetProperty("Position") == null)
- ? null
- : item.Metadata.Position;
+ string position = null;
+ var itemPosition = item as IPositioned;
+ if (itemPosition != null) {
+ position = itemPosition.Position;
+ }
+
return new { item, position };
}).ToList();
diff --git a/src/Orchard/ContentManagement/ContentPart.cs b/src/Orchard/ContentManagement/ContentPart.cs
index cdb4bbfbe..16ed02311 100644
--- a/src/Orchard/ContentManagement/ContentPart.cs
+++ b/src/Orchard/ContentManagement/ContentPart.cs
@@ -21,14 +21,6 @@ namespace Orchard.ContentManagement {
public virtual ContentItem ContentItem { get; set; }
- //interesting thought, should/could parts also have zones (would then have zones on the page, content item and parts...)?
- private readonly IZoneCollection _zones = new ZoneCollection();
- public virtual IZoneCollection Zones {
- get {
- return _zones;
- }
- }
-
///
/// The ContentItem's identifier.
///
diff --git a/src/Orchard/DisplayManagement/IPositioned.cs b/src/Orchard/DisplayManagement/IPositioned.cs
new file mode 100644
index 000000000..898cdc76a
--- /dev/null
+++ b/src/Orchard/DisplayManagement/IPositioned.cs
@@ -0,0 +1,5 @@
+namespace Orchard.DisplayManagement {
+ public interface IPositioned {
+ string Position { get; }
+ }
+}
\ No newline at end of file
diff --git a/src/Orchard/DisplayManagement/IShape.cs b/src/Orchard/DisplayManagement/IShape.cs
index 27ad21151..5ec1483cb 100644
--- a/src/Orchard/DisplayManagement/IShape.cs
+++ b/src/Orchard/DisplayManagement/IShape.cs
@@ -1,5 +1,4 @@
-using System.Diagnostics;
-using Orchard.DisplayManagement.Shapes;
+using Orchard.DisplayManagement.Shapes;
namespace Orchard.DisplayManagement {
///
diff --git a/src/Orchard/DisplayManagement/PositionWrapper.cs b/src/Orchard/DisplayManagement/PositionWrapper.cs
new file mode 100644
index 000000000..e684bfdb5
--- /dev/null
+++ b/src/Orchard/DisplayManagement/PositionWrapper.cs
@@ -0,0 +1,26 @@
+using System.Web;
+
+namespace Orchard.DisplayManagement {
+ public class PositionWrapper : IHtmlString, IPositioned {
+
+ private IHtmlString _value;
+ public string Position { get; private set; }
+
+ public PositionWrapper(IHtmlString value, string position) {
+ _value = value;
+ Position = position;
+ }
+
+ public PositionWrapper(string value, string position)
+ : this(new HtmlString(HttpUtility.HtmlEncode(value)), position) {
+ }
+
+ public string ToHtmlString() {
+ return _value.ToHtmlString();
+ }
+
+ public override string ToString() {
+ return _value.ToString();
+ }
+ }
+}
diff --git a/src/Orchard/DisplayManagement/Shapes/Shape.cs b/src/Orchard/DisplayManagement/Shapes/Shape.cs
index d009d1123..a3e30e6d8 100644
--- a/src/Orchard/DisplayManagement/Shapes/Shape.cs
+++ b/src/Orchard/DisplayManagement/Shapes/Shape.cs
@@ -4,11 +4,11 @@ using System.Dynamic;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
-using System.Web.Mvc;
+using System.Web;
namespace Orchard.DisplayManagement.Shapes {
[DebuggerTypeProxy(typeof(ShapeDebugView))]
- public class Shape : Composite, IShape, IEnumerable