Hot answers tagged

1

You could sort using the multisort filter (docs) then paginate using Yii's ArrayDataProvider - see this post for reference. {# Fetch your entries and order by theYear descending #} {% set allEntriesByYear = craft.entries() .section('library') .orderBy('postDate DESC') .theYear(':notempty:') .with(['theYear']) .all() | multisort(e => e....


Only top voted, non community-wiki answers of a minimum length are eligible