diff --git a/code/controller/CMSPageEditController.php b/code/controller/CMSPageEditController.php index 47dfe085..aac1cc92 100644 --- a/code/controller/CMSPageEditController.php +++ b/code/controller/CMSPageEditController.php @@ -7,7 +7,15 @@ class CMSPageEditController extends CMSMain { function getEditForm($id = null, $fields = null) { $record = $this->getRecord($id ? $id : $this->currentPageID()); - return parent::getEditForm($record, ($record) ? $record->getCMSFields() : null); + $form = parent::getEditForm($record, ($record) ? $record->getCMSFields() : null); + + // TODO Replace with preview button + $form->Fields()->addFieldToTab( + 'Root.Main', + new LiteralField('SwitchView', sprintf('
%s
', $this->SwitchView())) + ); + + return $form; } } \ No newline at end of file