Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » ModelAdmin remove back button?

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

Page: 1
Go to End
Author Topic: 683 Views
  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    ModelAdmin remove back button? Link to this post

    Hi,

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

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: ModelAdmin remove back button? Link to this post

    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;
       }
    ...
    }

    683 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.