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 = CMSForm::create( $this, 'EditForm', $fields, $actions )->setHTMLID('Form_EditForm'); $form->setResponseNegotiator($this->getResponseNegotiator()); $form->addExtraClass('cms-add-form cms-content center cms-edit-form'); // 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