Skip to content

Commit

Permalink
Force tab to show before MetaData
Browse files Browse the repository at this point in the history
  • Loading branch information
hailwood committed Nov 4, 2015
1 parent 7b4024d commit 3e4af43
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions code/Extensions/FrequentlyAskedQuestionsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ public function updateCMSFields(FieldList $fields) {
'Title' => 'Question',
'Answer.Summary' => 'Answer Preview',
]);

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

$GridField = GridField::create('FaqSegments', 'FAQs', $this->owner->Faqs(), $gridConfig);

Expand Down

0 comments on commit 3e4af43

Please sign in to comment.