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.

Customising the CMS

How to add buttons and actions to the CMS


3 Posts   298 Views


30 April 2014 at 8:54am (Last edited: 30 April 2014 8:55am), Community Member, 8 Posts

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();

$fields->addFieldsToTab("Root.ButtonTest", array(
FormAction::create('doAction', 'Action button')

return $fields;

public function doAction()
//Do something

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();
//Something here?

I can't find any clear documentation on how to handle the button action.

Note: Same question on SO if you want the rep


6 May 2014 at 9:26am Community Member, 8 Posts

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 Forum Moderator, 149 Posts

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