Create similar buttons like Save and Publish

Topics: Customizing Orchard, Writing modules
May 5, 2012 at 12:02 AM


I want to show two more buttons on all my content pages, like Cancel and Delete along with the default buttons Save & Publish that gets displayed.

If I create a module, then I have to manually attach that part to all my content items which I want to avoid.



May 5, 2012 at 9:03 AM

You could:

  • Override some shape the specific content types' parts have and include the buttons there.
  • Write a new driver for a part the content types have: since parts can have an arbitrary number of drivers, with this you can attach new shapes to existing parts.
May 5, 2012 at 9:45 AM

override the template in your theme and create two additional links to cancel and delete. (use css to show it as a button or us javascript instead) 

Jul 3, 2012 at 10:06 PM


If overriding the Content.SaveButton.cshtml template in order to add a Cancel and Delete button, how would you actually code the Delete button to dynamically pass the proper ContentItem Id to the action for deletion?

Jul 4, 2012 at 11:55 AM

You can use ItemRemoveUrl to get the delete url, just past the content item and return url.

@Url.ItemRemoveUrl((Orchard.ContentManagement.ContentItem)@Model.ContentItem, null)