Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivoba/4399001 to your computer and use it in GitHub Desktop.
Save ivoba/4399001 to your computer and use it in GitHub Desktop.
<?php
class MemberProfileFieldExtension extends DataExtension {
public static $db = array(
'SortOrder' => 'Int'
);
function updateCMSFields(FieldList $fields) {
$fields->push(new NumericField('SortOrder', 'SortOrder'));
parent::updateCMSFields($fields);
}
}
<?php
class SortableMemberProfilePage extends MemberProfilePage {
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->dataFieldByName('Fields')->getConfig()->addComponent(new GridFieldSortableRows('SortOrder'));
return $fields;
}
}
class SortableMemberProfilePage_Controller extends MemberProfilePage_Controller {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment