I need to order the results of a search query after I got back the results. The reason to do this is that I want to make different lists on the same page (with the same results) and I dont't want to search over and over again just to reorder te results. Can I do that? So basically I do this:
{% set results = craft.entries.section('player').search('team:"thenameoftheteam"') %}
What I want to do with this result is: loop
- through the results and order them by
playerPosition
- show the longest player (lengths are in the field
playerHeight
) - show the oldest player (birth dates are in the field
playerBirth
)
I could run this query 3 times and order by a different field each time, but I don't think that's the way to go.