Specializing a widget's alternate to use the shape name too. Otherwise there

could be conflicts if two shapes are returned for the same content item.

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2011-10-12 17:00:44 -07:00
parent 212483445c
commit 8b4c249e07

View File

@@ -31,8 +31,8 @@ namespace Orchard.DesignerTools.Services {
// Add 2 alternates for flexible widget shape naming:
// [ShapeName]-[ZoneName].cshtml: (e.g. "Parts.Blogs.RecentBlogPosts-myZoneName.cshtml")
// [ContentTypeName]-[ZoneName].cshtml: (e.g. "RecentBlogPosts-myZoneName.cshtml")
displayedContext.ShapeMetadata.Alternates.Add(contentTypeName + "__" + zoneName);
// [ShapeName]-[ContentTypeName]-[ZoneName].cshtml: (e.g. "Parts.Common.Body-RecentBlogPosts-myZoneName.cshtml")
displayedContext.ShapeMetadata.Alternates.Add(shapeName + "__" + contentTypeName + "__" + zoneName);
displayedContext.ShapeMetadata.Alternates.Add(shapeName + "__" + zoneName);
}
}