New answers tagged sorting
1
I would like to thank Michael Rog for supplying an answer at this similar question about SuperSort:
Sorting an array of entries according to a fixed list/array of items
The code that lets me sort by instrument in any order I want:
{% set relatedMusicians = craft.entries.section('bios').relatedTo(entry)
.with(['bioPhoto'])
.all()
%}
{% set ...
1
As of SuperSort 3.1.0, you can use the customOrderSort and customOrderSortAs methods to accomplish this:
{% set shops = craft.entries.section('shops')... %}
{% set customOrderList = [
'SomeShopType',
'AnotherShopType',
'OneMoreShopType'
] %}
{% set sortedShops = shops
| supersort('customOrderSortAs', as='{shopType}', comp=customOrderList) %}...
Top 50 recent answers are included
Related Tags
sorting × 68entries × 20
templating × 11
categories × 9
matrix × 8
ordering × 8
plugin-supersort × 7
craft3 × 6
control-panel × 5
relations × 4
structure × 4
group × 4
elementcriteriamodel × 3
admin × 3
frontend × 3
array × 3
order × 3
assets × 2
tags × 2
forloop × 2
entries-field × 2
entry-type × 2
relatedto × 2
queries × 2
custom × 2