Contents module redirects to an items AdminRouteValues from metadata after creation. Normally it is just its edit screen, but this allows handlers to customize this per item. Lists for example redirect to the lists contents rather than jump to the list properties screen.

--HG--
branch : dev
This commit is contained in:
Dave Reed
2011-03-14 13:09:03 -07:00
parent 82d286e8ea
commit cf241ae898

View File

@@ -238,7 +238,8 @@ namespace Orchard.Core.Contents.Controllers {
Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName)
? T("Your content has been created.")
: T("Your {0} has been created.", contentItem.TypeDefinition.DisplayName));
return RedirectToAction("Edit", new RouteValueDictionary { { "Id", contentItem.Id } });
var adminRouteValues = _contentManager.GetItemMetadata(contentItem).AdminRouteValues;
return RedirectToRoute(adminRouteValues);
}
public ActionResult Edit(int id) {