Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Backlinks in CMS edit form template, first defined in GridField…

…PopupForms
  • Loading branch information...
commit f1775b5f8459ea6fd415aa782a5e5bb80073d0a7 1 parent 8ff8d32
@chillu chillu authored
View
4 admin/templates/CMSGridFieldPopupForms.ss
@@ -1,4 +0,0 @@
-<div class="cms-content-fields center">
- <a class="backlink ss-ui-button" href="$Backlink">Back</a>
- $ItemEditForm
-</div>
View
7 admin/templates/Includes/LeftAndMain_EditForm.ss
@@ -20,6 +20,13 @@
<% end_if %>
<!-- <div class="cms-content-search">...</div> -->
+
+ <% if Backlink %>
+ <a class="backlink ss-ui-button" href="$Backlink">
+ <% _t('Back', 'Back') %>
+ </a>
+ <% end_if %>
+
</div>
</div>
View
5 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(
Please sign in to comment.
Something went wrong with that request. Please try again.