5540 Posts in 1738 Topics by 1224 members
|Go to End|
30 April 2014 at 8:54am Last edited: 30 April 2014 8:55am
How do I go about adding a button to the backend of the CMS?
I can display the button where I want using:
public function getCMSFields()
$fields = parent::getCMSFields();
FormAction::create('doAction', 'Action button')
public function doAction()
However, doAction does nothing when the button is clicked.
I've seen one example of how to put a button on the main action bar (Next to save/publish) but thats not what I'm trying to do.
Looking at the only documentation page I can find, do I need to do something within
public function getCMSActions()
$actions = parent::getCMSActions();
I can't find any clear documentation on how to handle the button action.
Note: Same question on SO if you want the rep https://stackoverflow.com/questions/23353998/adding-button-to-silverstripe-cms
6 May 2014 at 9:26am
Core framework needs some work if its so complicated to add a simple button and action that nobody has a clue how to do it eh?
6 May 2014 at 12:53pm
Can you perhaps provide some more insight into the outcome you are trying to get here?
What are you building?, where do you want this button to appear and what do you want to happen when it is clicked? From what I know, FormAction is designed to create a button which submits a form, rather than a stand alone button that will just trigger a php method to run.
Give some context to your question
|Go to Top|