mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 21:13: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.Containers.Models;
|
||||||
using Orchard.Core.Routable.Models;
|
using Orchard.Core.Routable.Models;
|
||||||
using Orchard.DisplayManagement;
|
using Orchard.DisplayManagement;
|
||||||
|
using Orchard.Mvc;
|
||||||
using Orchard.Themes;
|
using Orchard.Themes;
|
||||||
using Orchard.UI.Navigation;
|
using Orchard.UI.Navigation;
|
||||||
using Orchard.Settings;
|
using Orchard.Settings;
|
||||||
@@ -71,14 +72,16 @@ namespace Orchard.Core.Containers.Controllers {
|
|||||||
|
|
||||||
var list = Shape.List();
|
var list = Shape.List();
|
||||||
list.AddRange(pageOfItems.Select(item => _contentManager.BuildDisplay(item, "Summary")));
|
list.AddRange(pageOfItems.Select(item => _contentManager.BuildDisplay(item, "Summary")));
|
||||||
|
list.Classes.Add("content-items");
|
||||||
|
list.Classes.Add("list-items");
|
||||||
|
|
||||||
dynamic viewModel = Shape.ViewModel()
|
var model = _contentManager.BuildDisplay(container, "Detail");
|
||||||
.ContentItems(list)
|
model.Content.Add(list, "5");
|
||||||
.Pager(pagerShape)
|
if (container.As<ContainerPart>().Record.Paginated) {
|
||||||
.ShowPager(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 new ShapeResult(this, model);
|
||||||
return View((object)viewModel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -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\Placement.info" />
|
||||||
<Content Include="Containers\Views\EditorTemplates\ContainerWidget.cshtml" />
|
<Content Include="Containers\Views\EditorTemplates\ContainerWidget.cshtml" />
|
||||||
<Content Include="Containers\Views\EditorTemplates\Container.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\ContainerPartSettings.cshtml" />
|
||||||
<Content Include="Containers\Views\DefinitionTemplates\ContainerTypePartSettings.cshtml" />
|
<Content Include="Containers\Views\DefinitionTemplates\ContainerTypePartSettings.cshtml" />
|
||||||
<Content Include="Containers\Views\EditorTemplates\Containable.cshtml" />
|
<Content Include="Containers\Views\EditorTemplates\Containable.cshtml" />
|
||||||
|
@@ -3,6 +3,11 @@
|
|||||||
<!--
|
<!--
|
||||||
Parts_Container_Contained_SummaryAdmin
|
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">
|
<Match DisplayType="SummaryAdmin">
|
||||||
<Place Parts_Container_Contained_SummaryAdmin="Actions:10"/>
|
<Place Parts_Container_Contained_SummaryAdmin="Actions:10"/>
|
||||||
</Match>
|
</Match>
|
||||||
|
Reference in New Issue
Block a user