本文整理汇总了C#中Orchard.ContentManagement.Handlers.GetContentItemMetadataContext类的典型用法代码示例。如果您正苦于以下问题:C# GetContentItemMetadataContext类的具体用法?C# GetContentItemMetadataContext怎么用?C# GetContentItemMetadataContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GetContentItemMetadataContext类属于Orchard.ContentManagement.Handlers命名空间,在下文中一共展示了GetContentItemMetadataContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context)
{
var hotel = context.ContentItem.As<HotelPart>();
if (hotel == null) return;
context.Metadata.CreateRouteValues = new RouteValueDictionary
{
{ "Area", "Summit.Core" },
{ "Controller", "HotelAdmin" },
{ "Action", "Create" },
{ "destinationId", hotel.DestinationPart.Id }
};
context.Metadata.EditorRouteValues = new RouteValueDictionary
{
{ "Area", "Summit.Core" },
{ "Controller", "HotelAdmin" },
{ "Action", "Edit" },
{ "hotelId", context.ContentItem.Id },
{ "destinationId", hotel.DestinationPart.Id }
};
context.Metadata.RemoveRouteValues = new RouteValueDictionary
{
{ "Area", "Summit.Core" },
{ "Controller", "HotelAdmin" },
{ "Action", "Delete" },
{ "hotelId", context.ContentItem.Id },
{ "destinationId", hotel.DestinationPart.Id }
};
}
示例2: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context)
{
var featuredItemPart = context.ContentItem.As<FeaturedItemPart>();
if (featuredItemPart != null) {
context.Metadata.DisplayText = featuredItemPart.Headline;
}
}
示例3: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context)
{
if (context.ContentItem.ContentType != "Site")
return;
base.GetItemMetadata(context);
context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Comments")));
}
示例4: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var part = context.ContentItem.As<LayerPart>();
if (part != null) {
context.Metadata.Identity.Add("Layer.LayerName", part.Name);
}
}
示例5: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var part = context.ContentItem.As<IdentityPart>();
if (part != null) {
context.Metadata.Identity.Add("Identifier", part.Identifier);
}
}
示例6: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
if(context.ContentItem.ContentType != "Menu") {
return;
}
context.Metadata.Identity.Add("name", context.ContentItem.As<TitlePart>().Title);
}
示例7: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var blogPost = context.ContentItem.As<BlogPostPart>();
// BlogPart can be null if this is a new Blog Post item.
if (blogPost == null || blogPost.BlogPart == null) {
return;
}
context.Metadata.CreateRouteValues = new RouteValueDictionary {
{"Area", "Orchard.Blogs"},
{"Controller", "BlogPostAdmin"},
{"Action", "Create"},
{"blogId", blogPost.BlogPart.Id}
};
context.Metadata.EditorRouteValues = new RouteValueDictionary {
{"Area", "Orchard.Blogs"},
{"Controller", "BlogPostAdmin"},
{"Action", "Edit"},
{"postId", context.ContentItem.Id},
{"blogId", blogPost.BlogPart.Id}
};
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
{"Area", "Orchard.Blogs"},
{"Controller", "BlogPostAdmin"},
{"Action", "Delete"},
{"postId", context.ContentItem.Id},
{"blogId", blogPost.BlogPart.Id}
};
}
示例8: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var part = context.ContentItem.As<MenuItemPart>();
if (part != null) {
context.Metadata.Identity.Add("MenuItem.Url", part.Url);
}
}
示例9: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var part = context.ContentItem.As<ITitleAspect>();
if (part != null) {
context.Metadata.DisplayText = part.Title;
}
}
示例10: GetContentItemMetadata
public override void GetContentItemMetadata(GetContentItemMetadataContext context) {
if (context.Metadata.CreateRouteValues == null) {
context.Metadata.CreateRouteValues = new RouteValueDictionary {
{"Area", "Contents"},
{"Controller", "Admin"},
{"Action", "Create"},
{"Id", context.ContentItem.ContentType}
};
}
if (context.Metadata.EditorRouteValues == null) {
context.Metadata.EditorRouteValues = new RouteValueDictionary {
{"Area", "Contents"},
{"Controller", "Admin"},
{"Action", "Edit"},
{"Id", context.ContentItem.Id}
};
}
if (context.Metadata.DisplayRouteValues == null) {
context.Metadata.DisplayRouteValues = new RouteValueDictionary {
{"Area", "Contents"},
{"Controller", "Item"},
{"Action", "Display"},
{"Id", context.ContentItem.Id}
};
}
if (context.Metadata.RemoveRouteValues == null) {
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
{"Area", "Contents"},
{"Controller", "Admin"},
{"Action", "Remove"},
{"Id", context.ContentItem.Id}
};
}
}
示例11: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var part = context.ContentItem.As<PackageVersionPart>();
if (part == null)
return;
var container = part.CommonPart.Container.As<PackagePart>();
if (container == null)
return;
if (!String.IsNullOrWhiteSpace(container.PackageId)) {
context.Metadata.Identity.Add("package-version-id", container.PackageId.ToLowerInvariant() + "/" + part.Version);
}
context.Metadata.DisplayText = container.TitlePart.Title + " " + part.Version;
context.Metadata.DisplayRouteValues = new RouteValueDictionary {
{"Area", "Orchard.Gallery"},
{"Controller", "PackageVersion"},
{"Action", "Display"},
{"id", container.PackageId},
{"version", part.Version}
};
}
示例12: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var TimetableAppointment = context.ContentItem.As<TimetableAppointmentPart>();
if (TimetableAppointment == null)
return;
context.Metadata.CreateRouteValues = new RouteValueDictionary {
{"Area", "Alois.Timetables"},
{"Controller", "TimetableAppointmentAdmin"},
{"Action", "Create"},
{"TimetableId", TimetableAppointment.TimetablePart.Id}
};
context.Metadata.EditorRouteValues = new RouteValueDictionary {
{"Area", "Alois.Timetables"},
{"Controller", "TimetableAppointmentAdmin"},
{"Action", "Edit"},
{"postId", context.ContentItem.Id},
{"TimetableId", TimetableAppointment.TimetablePart.Id}
};
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
{"Area", "Alois.Timetables"},
{"Controller", "TimetableAppointmentAdmin"},
{"Action", "Delete"},
{"postId", context.ContentItem.Id},
{"TimetableSlug", TimetableAppointment.TimetablePart.As<RoutePart>().Slug}
};
}
示例13: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
if (context.ContentItem.ContentType != "Site")
return;
base.GetItemMetadata(context);
// Add in the menu option for the Settings
context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Page Title Override")));
}
示例14: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var widget = context.ContentItem.As<WidgetPart>();
if (widget == null)
return;
// create needs to go through the add widget flow (index -> [select layer -> ] add [widget type] to layer)
context.Metadata.CreateRouteValues = new RouteValueDictionary {
{"Area", "Orchard.Widgets"},
{"Controller", "Admin"},
{"Action", "Index"}
};
context.Metadata.EditorRouteValues = new RouteValueDictionary {
{"Area", "Orchard.Widgets"},
{"Controller", "Admin"},
{"Action", "EditWidget"},
{"Id", context.ContentItem.Id}
};
// remove goes through edit widget...
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
{"Area", "Orchard.Widgets"},
{"Controller", "Admin"},
{"Action", "EditWidget"},
{"Id", context.ContentItem.Id}
};
}
示例15: GetItemMetadata
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var Timetable = context.ContentItem.As<TimetablePart>();
if (Timetable == null)
return;
var TimetableSlug = Timetable.Id == _routableHomePageProvider.GetHomePageId(_workContextAccessor.GetContext().CurrentSite.HomePage)
? ""
: Timetable.As<RoutePart>().Slug;
context.Metadata.DisplayRouteValues = new RouteValueDictionary {
{"Area", "Alois.Timetables"},
{"Controller", "Timetable"},
{"Action", "Item"},
{"TimetableSlug", TimetableSlug}
};
context.Metadata.CreateRouteValues = new RouteValueDictionary {
{"Area", "Alois.Timetables"},
{"Controller", "TimetableAdmin"},
{"Action", "Create"}
};
context.Metadata.EditorRouteValues = new RouteValueDictionary {
{"Area", "Alois.Timetables"},
{"Controller", "TimetableAdmin"},
{"Action", "Edit"},
{"TimetableId", context.ContentItem.Id}
};
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
{"Area", "Alois.Timetables"},
{"Controller", "TimetableAdmin"},
{"Action", "Remove"},
{"TimetableId", context.ContentItem.Id}
};
}