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.

Customising the CMS /

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

ModelAdmin remove back button?


Go to End


2 Posts   1515 Views

Avatar
swaiba

Forum Moderator, 1899 Posts

15 February 2011 at 6:14am

Edited: 15/02/2011 7:18am

Hi,

Has anyone got a quick snippet that will remove the 'back' button within ModelAdmin?
It would be very much appreciated

Avatar
swaiba

Forum Moderator, 1899 Posts

17 February 2011 at 3:24am

Edited: 17/02/2011 7:50am

thanks to a little help from simon_w on IRC...

class MyModelAdmin extends ModelAdmin {
...
	public static $record_controller_class = "MyModelAdmins_RecordController";
...
}

class MyModelAdmin_RecordController extends ModelAdmin_RecordController {
...
	public function EditForm() {
		$form = parent::EditForm();
		$fields = $form->Actions();
		$fields->removeByName('action_goBack');
		$form->setActions ($fields);
		return $form;
	}
...
}