mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Removing the IContentDisplayInfo interface in favor of new manager method GetItemMetadata
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042888
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Data;
|
||||
using Orchard.Models;
|
||||
@@ -17,6 +18,28 @@ namespace Orchard.Blogs.Models {
|
||||
Filters.Add(new ActivatingFilter<BodyAspect>("blogpost"));
|
||||
Filters.Add(new StorageFilter<BlogPostRecord>(repository));
|
||||
OnLoaded<BlogPost>((context, bp) => bp.Blog = contentManager.Get<Blog>(bp.Record.Blog.Id));
|
||||
|
||||
OnGetItemMetadata<BlogPost>((context, bp) => {
|
||||
context.Metadata.DisplayText = bp.Title;
|
||||
context.Metadata.DisplayRouteValues =
|
||||
new RouteValueDictionary(
|
||||
new {
|
||||
area = "Orchard.Blogs",
|
||||
controller = "BlogPost",
|
||||
action = "Item",
|
||||
blogSlug = bp.Blog.Slug,
|
||||
postSlug = bp.Slug
|
||||
});
|
||||
context.Metadata.EditorRouteValues =
|
||||
new RouteValueDictionary(
|
||||
new {
|
||||
area = "Orchard.Blogs",
|
||||
controller = "BlogPost",
|
||||
action = "Edit",
|
||||
blogSlug = bp.Blog.Slug,
|
||||
postSlug = bp.Slug
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user