diff --git a/admin/templates/CMSGridFieldPopupForms.ss b/admin/templates/CMSGridFieldPopupForms.ss deleted file mode 100644 index 1981a9b4bfc..00000000000 --- a/admin/templates/CMSGridFieldPopupForms.ss +++ /dev/null @@ -1,4 +0,0 @@ -
- Back - $ItemEditForm -
\ No newline at end of file diff --git a/admin/templates/Includes/LeftAndMain_EditForm.ss b/admin/templates/Includes/LeftAndMain_EditForm.ss index 87d637ab658..a4523ed6bc7 100644 --- a/admin/templates/Includes/LeftAndMain_EditForm.ss +++ b/admin/templates/Includes/LeftAndMain_EditForm.ss @@ -20,6 +20,13 @@ <% end_if %> + + <% if Backlink %> + + <% _t('Back', 'Back') %> + + <% end_if %> + diff --git a/forms/gridfield/GridFieldPopupForms.php b/forms/gridfield/GridFieldPopupForms.php index 2763e294fbb..168cc97f295 100755 --- a/forms/gridfield/GridFieldPopupForms.php +++ b/forms/gridfield/GridFieldPopupForms.php @@ -173,6 +173,11 @@ function edit($request) { $form->setTemplate($controller->getTemplatesWithSuffix('_EditForm')); $form->addExtraClass('cms-content center ss-tabset ' . $controller->BaseCSSClasses()); if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet'); + // TODO Link back to controller action (and edited root record) rather than index, + // which requires more URL knowledge than the current link to this field gives us. + // The current root record is held in session only, + // e.g. page/edit/show/6/ vs. page/edit/EditForm/field/MyGridField/.... + $form->Backlink = $controller->Link(); } $return = $this->customise(array(