Can't sort fields
Closed this issue · 3 comments
I'm wanting to have my membership form in a "natural order".
EG I have additional fields "Title" and "Postnominals"
These fields appear at the top of the registration form, whilst the "First Name" and "Surname" fields are at the bottom.
I've tried overriding as per this code with no success
public function updateMemberFormFields(FieldList $fields)
{
$firstName = $fields->dataFieldByName('FirstName');
$fields->removeByName('FirstName');
$fields->insertAfter('Title', $firstName);
}
As a note I found a workaround: manually adjusting Sort
in the MemberProfileField
and MemberProfileField_Live
tables. Perhaps the membership page gridfield could have a sortable component added to it?
Hi @altwohill, this should already be sortable, however you will need the appropriate module installed:
There's currently a suggestion that appears when installing this via composer https://github.com/symbiote/silverstripe-memberprofiles/blob/master/composer.json#L29. Would this happen to be the gridfield you're talking about?I'm going to close this as it should already support sorting (as above). If this doesn't happen to support sorting (i.e. this is a different gridfield), please let me know and we can re-open this accordingly.