diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ProjectionElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ProjectionElementDriver.cs index 9d12690ef..f3f01a8f2 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ProjectionElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ProjectionElementDriver.cs @@ -103,6 +103,9 @@ namespace Orchard.Layouts.Drivers { // Execute the query. var contentItems = _projectionManager.GetContentItems(query.Id, pager.GetStartIndex() + element.Skip, pager.PageSize).ToList(); + context.ElementShape.ContentItems = contentItems; + context.ElementShape.BuildShapes = (Func>) (displayType => contentItems.Select(x => _contentManager.BuildDisplay(x, displayType))); + // TODO: Figure out if we need this for a Projection Element, and if so, how. //// Sanity check so that content items with ProjectionPart can't be added here, or it will result in an infinite loop. //contentItems = contentItems.Where(x => !x.Has()).ToList(); diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj b/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj index b428dc728..0ccb86dd7 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj @@ -24,6 +24,7 @@ + true @@ -616,6 +617,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Views/Elements/Projection.Design.cshtml b/src/Orchard.Web/Modules/Orchard.Layouts/Views/Elements/Projection.Design.cshtml new file mode 100644 index 000000000..7919b2d76 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Views/Elements/Projection.Design.cshtml @@ -0,0 +1,11 @@ +@{ + var contentShapes = ((Func>)Model.BuildShapes)("Summary").ToList(); + var list = New.List(); + list.AddRange(contentShapes); +} +@if (contentShapes.Any()) { + @Display(list) +} +else { +

@T("The query returned no results.")

+} \ No newline at end of file