#5270: Fixed Shape type not found error.

This commit is contained in:
Sipke Schoorstra
2015-06-07 00:25:58 +02:00
parent 0c7b52e1be
commit e810d885a0
3 changed files with 45 additions and 0 deletions

View File

@@ -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<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();

View File

@@ -24,6 +24,7 @@
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -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>

View File

@@ -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>
}