mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Lists no longer need to specialize the entire Content.SummaryAdmin shape by using the new AdminLink metadata.
--HG-- branch : dev
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System.Web.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
@@ -70,5 +71,20 @@ namespace Orchard.Core.Containers.Drivers {
|
||||
part.Record.OrderByDirection = (int)OrderByDirection.Descending;
|
||||
});
|
||||
}
|
||||
|
||||
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
|
||||
var container = context.ContentItem.As<ContainerPart>();
|
||||
|
||||
if (container == null)
|
||||
return;
|
||||
|
||||
// containers link to their contents in admin screens
|
||||
context.Metadata.AdminRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "List"},
|
||||
{"containerId", container.Id}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user