5093 Posts in 1516 Topics by 1113 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 155 Views |
-
Remove Preview Button

4 February 2013 at 6:12am
I want to remove (or at least hide) the Preview button on some of my pagetypes, because those pagetypes are only viewable within their parent pages. Thus the preview will fail and looks terrible at the front-end
Found this, but doesn't worked:
public function EditForm() {
$form = parent::EditForm();
$actions = $form->Actions();
$actions->removeByName('Preview'); // remove save button from form
return $form;
}
function getCMSActions(){
$actions = parent::getCMSActions();
$Action = new FormAction(
"doAction",
"Do something different"
);
$actions->push($Action);
$actions->removeByName('Save');
$actions->removeByName('Unpublish');
$actions->removeByName('Publish');
$actions->removeByName('Delete');
$actions->removeByName('Preview');
return $actions;
}
| 155 Views | ||
|
Page:
1
|
Go to Top |

