mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00
#17426: Content item with Container part renders without other parts
--HG-- branch : 1.x
This commit is contained in:
@@ -7,6 +7,7 @@ using Orchard.Core.Containers.Extensions;
|
||||
using Orchard.Core.Containers.Models;
|
||||
using Orchard.Core.Routable.Models;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Themes;
|
||||
using Orchard.UI.Navigation;
|
||||
using Orchard.Settings;
|
||||
@@ -71,14 +72,16 @@ namespace Orchard.Core.Containers.Controllers {
|
||||
|
||||
var list = Shape.List();
|
||||
list.AddRange(pageOfItems.Select(item => _contentManager.BuildDisplay(item, "Summary")));
|
||||
list.Classes.Add("content-items");
|
||||
list.Classes.Add("list-items");
|
||||
|
||||
dynamic viewModel = Shape.ViewModel()
|
||||
.ContentItems(list)
|
||||
.Pager(pagerShape)
|
||||
.ShowPager(container.As<ContainerPart>().Record.Paginated);
|
||||
var model = _contentManager.BuildDisplay(container, "Detail");
|
||||
model.Content.Add(list, "5");
|
||||
if (container.As<ContainerPart>().Record.Paginated) {
|
||||
model.Content.Add(pagerShape, "5.1");
|
||||
}
|
||||
|
||||
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
|
||||
return View((object)viewModel);
|
||||
return new ShapeResult(this, model);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
@{
|
||||
IEnumerable<object> items = Model.ContentItems;
|
||||
Model.ContentItems.Classes.Add("content-items");
|
||||
Model.ContentItems.Classes.Add("list-items");
|
||||
}
|
||||
@Display(items)
|
||||
@if (Model.ShowPager) {
|
||||
@Display(Model.Pager)
|
||||
}
|
@@ -385,7 +385,6 @@
|
||||
<Content Include="Containers\Placement.info" />
|
||||
<Content Include="Containers\Views\EditorTemplates\ContainerWidget.cshtml" />
|
||||
<Content Include="Containers\Views\EditorTemplates\Container.cshtml" />
|
||||
<Content Include="Containers\Views\Item\Display.cshtml" />
|
||||
<Content Include="Containers\Views\DefinitionTemplates\ContainerPartSettings.cshtml" />
|
||||
<Content Include="Containers\Views\DefinitionTemplates\ContainerTypePartSettings.cshtml" />
|
||||
<Content Include="Containers\Views\EditorTemplates\Containable.cshtml" />
|
||||
|
@@ -3,6 +3,11 @@
|
||||
<!--
|
||||
Parts_Container_Contained_SummaryAdmin
|
||||
-->
|
||||
<Match ContentType="List" DisplayType="Detail">
|
||||
<!-- don't show the List title or Common Metadata -->
|
||||
<Place Parts_RoutableTitle="-" />
|
||||
<Place Parts_Common_Metadata="-" />
|
||||
</Match>
|
||||
<Match DisplayType="SummaryAdmin">
|
||||
<Place Parts_Container_Contained_SummaryAdmin="Actions:10"/>
|
||||
</Match>
|
||||
|
Reference in New Issue
Block a user