mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-19 17:51:45 +08:00
Core/Contents: ContentsHandler now initializes the DisplayText to the content item's ContentType
This commit is contained in:
@@ -4,6 +4,9 @@ using Orchard.ContentManagement.Handlers;
|
||||
namespace Orchard.Core.Contents.Handlers {
|
||||
public class ContentsHandler : ContentHandlerBase {
|
||||
public override void GetContentItemMetadata(GetContentItemMetadataContext context) {
|
||||
if (string.IsNullOrWhiteSpace(context.Metadata.DisplayText))
|
||||
context.Metadata.DisplayText = context.ContentItem.ContentType;
|
||||
|
||||
if (context.Metadata.CreateRouteValues == null) {
|
||||
context.Metadata.CreateRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
@@ -12,6 +15,7 @@ namespace Orchard.Core.Contents.Handlers {
|
||||
{"Id", context.ContentItem.ContentType}
|
||||
};
|
||||
}
|
||||
|
||||
if (context.Metadata.EditorRouteValues == null) {
|
||||
context.Metadata.EditorRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
@@ -20,6 +24,7 @@ namespace Orchard.Core.Contents.Handlers {
|
||||
{"Id", context.ContentItem.Id}
|
||||
};
|
||||
}
|
||||
|
||||
if (context.Metadata.DisplayRouteValues == null) {
|
||||
context.Metadata.DisplayRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
@@ -28,6 +33,7 @@ namespace Orchard.Core.Contents.Handlers {
|
||||
{"Id", context.ContentItem.Id}
|
||||
};
|
||||
}
|
||||
|
||||
if (context.Metadata.RemoveRouteValues == null) {
|
||||
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
|
||||
Reference in New Issue
Block a user