Reputation: 133
when you hit edit in orchard for a menu it takes you to the widget. I am trying to figure out how to make the edit link go to the specific navigation that the menu widget holds.
Upvotes: 0
Views: 53
Reputation: 13366
You can alter default Display/Edit/Remove links for any content item by using OnGetContentItemMetadata
method inside a content handler.
In your specific example, making edit link for a widget to point to the underlying menu editor would look like:
public class MyHandler : ContentHandler
{
public MyHandler()
{
OnGetContentItemMetadata<MenuWidgetPart>((ctx, part) =>
{
ctx.Metadata.EditorRouteValues = new RouteValueDictionary
{
{ "Area", "Navigation" },
{ "Controller", "Admin" },
{ "Action", "Index" },
{ "menuId", part.MenuContentItemId }
};
});
}
}
Upvotes: 1