setCallback('CurrentForm', function() use(&$controller) { return $controller->renderWith($controller->getTemplatesWithSuffix('_Content')); }); return $neg; } /** * @return Form */ public function getEditForm($id = null, $fields = null) { $siteConfig = SiteConfig::current_site_config(); $fields = $siteConfig->getCMSFields(); // Tell the CMS what URL the preview should show $fields->push(new HiddenField('PreviewURL', 'Preview URL', RootURLController::get_homepage_link())); // Added in-line to the form, but plucked into different view by LeftAndMain.Preview.js upon load $fields->push($navField = new LiteralField('SilverStripeNavigator', $this->getSilverStripeNavigator())); $navField->setAllowHTML(true); $actions = $siteConfig->getCMSActions(); $form = new Form($this, 'EditForm', $fields, $actions); $form->addExtraClass('root-form'); $form->addExtraClass('cms-edit-form cms-panel-padded center'); // don't add data-pjax-fragment=CurrentForm, its added in the content template instead if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet'); $form->setHTMLID('Form_EditForm'); $form->loadDataFrom($siteConfig); $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); // Use