Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Unpublish / Delete buttons in ModelAdmin/ReModelAdmin


Reply

3 Posts   569 Views

Avatar
KINKCreative

12 November 2011 at 4:29am Community Member, 56 Posts

Been looking for a while to figure this out - I am having people add content via UncleCheese's RemodelAdmin. I would like to add an Unpublish and Delete button to the modeladmin results table - I haven't worked with actions in the CMS so don't really know how to start. I'm guessing I will be adding a SummaryField, each with a custom button / link, and they will submit to a form action in the ModelAdmin. Any tips - where should I be looking? Thanks :)

Avatar
swaiba

15 November 2011 at 5:58am Forum Moderator, 1796 Posts

This might help...
http://www.ssbits.com/tutorials/2009/adding-a-cms-action-the-slightly-hacky-way/

Avatar
KINKCreative

16 November 2011 at 4:37am (Last edited: 16 November 2011 4:37am), Community Member, 56 Posts

Thanks - I was looking to add the buttons into the actual results table (e.g. when you click Search in ModelAdmin, you get a list of DataObjects - or, in this case, Pages). On the right side, there is normally a red X to delete, but it's not bound to work with SiteTree objects - as they are on multiple stages. This one just deletes the record from one table. I thought it'd be cool to have in that list already an Unpublish and Delete button. I guess since deleting doesn't take place that often, they can just go in and Unpublish one by one :)