Sorting a pagelist by a custom attribute and name

Permalink
I have a custom select attribute called job_title (each person has a job title), options are something like this:

Partners
Solicitors
Finance
Administration

I need to be able to sort the page list firstly alphabetical (name) and then by the job_title attribute. So what I need it for all the people associated with 'Partners' to be displayed first followed by everyone else.

I've found the following function:

$pl->sortByMultiple('ak_job_title asc', 'cName asc');


This displays the people, sorts by the job_title and persons name in alphabetical order which is not what I need.

 
JohntheFish replied on at Permalink Reply
JohntheFish
How big is the list?
magpie replied on at Permalink Reply
Currently 145 but will not get much bigger.
JohntheFish replied on at Permalink Reply
JohntheFish
What happens if you just flip the parameters to sortByMultiple about?

For other solutions:

My Uber List addon with Magic Data should be able to easily cope with that with no perceptible delay.

You could also have a look at PagList+. It has 2 levels of sort built in.