Model.Actions in Content.SummaryAdmin.cshtml

Topics: Writing modules
Mar 9, 2012 at 11:19 AM

I noticed that the rendering of the 'View | Unpublish | Edit | Delete' in an Admin list is populated by @Model.Actions

How do these work? Can I override these on my own Content Types to produce custom actions? Or can I override the View in my module so that it will only be used for one of my custom Content Types?


May 9, 2012 at 7:19 AM

I have managed to add an additional action to the menu using a basic link in a parts template for my Content Type:


@using MyModule.Core.Extensions;
@using MyModule.Core.Models;
@using Orchard.ContentManagement;

    ContentItem contentItem = Model.ContentItem;
    MyCustomPart terms = (MyCustomPart)contentItem.Get(typeof(MyCustomPart));
<a href="@Url.TermsForAdmin(terms)" title="@T("My custom actions")">@T("My Action")</a>@T(" | ")

But I still don't know how to get access to, and suppress, the other Actions.