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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Unpublish / Delete buttons in ModelAdmin/ReModelAdmin


Go to End


3 Posts   1115 Views

Avatar
DesignCollective

Community Member, 66 Posts

12 November 2011 at 4:29am

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

Forum Moderator, 1899 Posts

15 November 2011 at 5:58am

Avatar
DesignCollective

Community Member, 66 Posts

16 November 2011 at 4:37am

Edited: 16/11/2011 4:37am

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 :)