Skip to content

Commit

Permalink
Merge pull request #2 from TcFxGt4AGE/patch-2
Browse files Browse the repository at this point in the history
Update TestimonialsExtension.php
  • Loading branch information
hailwood authored Jan 11, 2017
2 parents a5d4837 + 49e51e7 commit 8c7298d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/Extensions/TestimonialsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function updateCMSFields(FieldList $fields)
->addComponent(new GridFieldAddNewButton('buttons-before-left'))
->addComponent(new GridFieldToolbarHeader())
->addComponent(new GridFieldSortableHeader())
->addComponent(new GridFieldSortableRows('SortOrder'))
->addComponent(new GridFieldOrderableRows('SortOrder'))
->addComponent($dataColumns = new GridFieldDataColumns())
->addComponent(new GridFieldEditButton())
->addComponent(new GridFieldDeleteAction())
Expand All @@ -29,6 +29,12 @@ public function updateCMSFields(FieldList $fields)
'Testimonial.Summary' => 'Testimonial Preview',
]);

/** @var TabSet $rootTab */
//We need to repush Metadata to ensure it is the last tab
$rootTab = $fields->fieldByName('Root');
$fields->removeByName('Testimonials');
$rootTab->push(Tab::create('Testimonials'));

$GridField = GridField::create('Testimonials', 'Testimonials', $this->owner->Testimonials(), $gridConfig);

$fields->addFieldToTab('Root.Testimonials', $GridField);
Expand Down

0 comments on commit 8c7298d

Please sign in to comment.