0

Wondering if it was possible to add additional actions when editing a page to the More options menu in Silverstripe 3.1

Using the below sample, I have added an additional FormAction which I can see when editing an page. But where do I actually add the "custom_action" method?

class CustomPage extends SiteTree {
  function getCMSActions(){
    $actions = parent::getCMSActions();

    $actions->addFieldToTab(
      'ActionMenus.MoreOptions', 
      new FormAction('custom_action', 'Custom Action')
    );

    return $actions;
  }
}

class CustomPage_Controller extends ContentController {
  public function init() {
    parent::init();

    if(!Member::currentUserID()) {
      die();
    }
  }
}
Sean Dooley
  • 615
  • 2
  • 11
  • 27

0 Answers0