Skip to content

Commit

Permalink
#5270: Fixed Shape type not found error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sipke Schoorstra committed Jun 6, 2015
1 parent 0c7b52e commit e810d88
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ protected override void OnDisplaying(Projection element, ElementDisplayContext c
// Execute the query.
var contentItems = _projectionManager.GetContentItems(query.Id, pager.GetStartIndex() + element.Skip, pager.PageSize).ToList();

context.ElementShape.ContentItems = contentItems;
context.ElementShape.BuildShapes = (Func<string, IEnumerable<dynamic>>) (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<ProjectionPart>()).ToList();
Expand Down
31 changes: 31 additions & 0 deletions src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -616,6 +617,36 @@
<ItemGroup>
<Content Include="Views\LayoutEditor.Template.Html.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Elements\Notifications.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Elements\Notifications.Design.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\EditorTemplates\Elements.Menu.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Elements\Menu.Design.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Elements\Menu.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Elements\Breadcrumbs.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Elements\Breadcrumbs.Design.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\EditorTemplates\Elements.Breadcrumbs.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Styles\LayoutEditor\Menu.less" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Elements\Projection.Design.cshtml" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@{
var contentShapes = ((Func<string, IEnumerable<dynamic>>)Model.BuildShapes)("Summary").ToList();
var list = New.List();
list.AddRange(contentShapes);
}
@if (contentShapes.Any()) {
@Display(list)
}
else {
<p>@T("The query returned no results.")</p>
}

0 comments on commit e810d88

Please sign in to comment.