Sorting by custom field
Permalink
I'm trying the following:
But it errors out as it can't see the custom field 'sponsor'. Do I need to do this another way?
use Concrete\Core\User\UserList; $list = new UserList(); $list->sortBy('sponsor'); $endlist = $list->getResults();
But it errors out as it can't see the custom field 'sponsor'. Do I need to do this another way?
I created custom attributes in the concrete5 UI.
Not sure if this works the same as for page attributes, but give this a try...
$list->sortBy('ak_sponsor');
$list->sortBy('ak_sponsor');
This actually does it. I'm getting a couple of minor issues, but it seems to do the sort as intended! Thanks.
Are you creating the custom field with code or in the concrete5 UI?