Skip to main content

Questions tagged [sort]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
25 views

Order structure entries by children's custom date field

I have entries as a structure (trainings ). The top-level elements are trainings (entry type training). Each training can have multiple children which represent training dates (entry type trainingDate)...
Andreas's user avatar
  • 491
0 votes
0 answers
32 views

How to build front-end dropdown to sort images with {% tag %} function?

how can I build a front-end HTML dropdown selector with the "tag" function in CraftCMS 4.x? I'd like the user to be able to sort a couple of masonry images that are associated with an entry ...
MvVijfeijken's user avatar
2 votes
1 answer
974 views

Orderby entry field?

I am getting music album entries with the following code: {% set entries = craft.entries() .section('releases') .orderBy('title ASC') .all() %} Rather than ordering by the title, ...
fxfuture's user avatar
  • 279
0 votes
1 answer
33 views

How to sort database values using other variable

I am fetching data using the custom slug in craft commerce products but I am not getting the sequence of the products which I am providing in the custom slug Here is the code for that. slugs = "...
Jaimini Solanki's user avatar
1 vote
1 answer
40 views

Sorting all matrix fields from multiple entries as one list

I have a section with a matrix field that collects multiple notes for each entry, each marked by the date the note is entered. Conceptually, the data is organized within the entries as: Entry A ...
Ed Hebert's user avatar
  • 145
1 vote
1 answer
92 views

Sort Repeater fields alphabetically

I have a supertable with over 79 repeater fields. Is there a way I can sort these fields in the frontend alphabetically? For example I have: Romania Germany Austria ... On the frontend I would like ...
loliki's user avatar
  • 151
2 votes
2 answers
97 views

sort by checkbox field with multiple options and by postDate desc

Section handle: players field handle: teamName The checkbox field has two options: Cubs Tigers Not all players will have the teamName field checked. I want to order players who are Cubs or Tigers ...
Brad's user avatar
  • 487
1 vote
1 answer
222 views

Order matrix blocks by date field

I'm using a matrix inside a Super Table to organize events, and I'd like to order the events using the date field for each event. I'm currently showing the first five events using limit then using ...
univers_'s user avatar
  • 185
1 vote
1 answer
1k views

Nesting level too deep - recursive dependency?

I've got a page with a couple of levels of loops. It takes a section of speakers, groups them by state, and then loops through the states, and then loops through speakers in that state. It's not too ...
Jake Dohm's user avatar
  • 766
1 vote
1 answer
69 views

Order grouped results by dropdown order

Following this topic, I have an additional question. The results are not ordered by the order of the Dropdown Options. How can I get this done? Code: {% set players = entry.myPlayersMatrix %} {% ...
levinDan's user avatar
1 vote
1 answer
43 views

Help with correct syntax regarding multisort please

Hi hoping for a quick resolution on this as a lot of scripting relies upon it. I have an array: {% set furniture = [ { 'name': 'chair', 'price': '100' }, { '...
cannon303's user avatar
  • 309
1 vote
1 answer
1k views

How to reorder structure entries in the Admin panel?

I converted a channel into a structure and now my entries are listed in reverse order. I have a very large number of entries. Is there a way or a plugin to permanently sort them and store the order?
fxfuture's user avatar
  • 279
1 vote
1 answer
278 views

How to create ordered list of categories from multiple category groups

I have got multiple category groups and I need to concatenate them into one list for a filter UI element. At the moment I have the following: {% set categories = craft.categories.group('colour').all(...
Jay's user avatar
  • 1,042
1 vote
2 answers
356 views

Syntax for Multisort Filter

I am trying to use the new multisort filter to sort an array in reverse order using a date key, but can't seem to figure out the correct syntax. Here is what I have: {% for rides in allRides|...
Roi Agneta's user avatar
  • 1,463
6 votes
1 answer
3k views

Order by score and another field

Currently I am sorting a category template with this: 'featured desc, postDate desc' Works as expected. But I would like to sort it first on the featured field, then on the score. Such as 'featured ...
Mosswalker's user avatar
0 votes
1 answer
6k views

Order twig array by date and time

I have a section called "events" in which I have a table field that contains dates and times of these events. So I want to order my events by date and within each day by time. I thought of mergin ...
outline4's user avatar
  • 595
2 votes
2 answers
387 views

Craft Commerce: Sort products by Sale price

Trying to sort products by price. {% set products = craft.commerce.products({ type: 'footwear', limit: shopSettings.productsPerPage, order: 'defaultPrice asc', }) %} It works fine. Please ...
Oleg's user avatar
  • 103
1 vote
1 answer
130 views

Sorting by date field across sections not working

I've seen a number of answers prescribing how to sort across different sections...but I'm not seeing it work. Here's what I've tried: {% set profileIds = craft.entries.section('profiles').order('...
Mark J. Reeves's user avatar
2 votes
2 answers
1k views

Sort entries by custom date in Matrix field / Super Table

I currently have numerous Super Tables with date fields inside and I am trying to get all table items to list themselves together in date order depending on what the user inputs. I have tried using ...
Amy's user avatar
  • 407
1 vote
1 answer
191 views

Retrieve entries by random sort, then resort alphabetically

I need to pull X entries with {% set randEntries = craft.entries.section('presenters').order('RAND()').limit(10) %} But then sort them alphabetically on entry.lastName. Do I need to Supersort for ...
4midori's user avatar
  • 656
0 votes
1 answer
119 views

Extend order methods to sort numbers naturally

I've encountered a similar problem as in this post: How to order numbers naturally? I have some products I need sorted on a page by model number, and currently they sort as ABC-1, ABC-12, ABC-2, etc. ...
Joel's user avatar
  • 127
2 votes
1 answer
1k views

Craft Commerce: Sort Products By Price

Trying to sort products by price. Since the price of a product in Commerce isn't a textual custom field it's attached to a variant, I'm having trouble working out the syntax to make this happen. {% ...
R0wan's user avatar
  • 335
2 votes
1 answer
151 views

Query two sections filtered by different custom fields, then order them

Two channels: 1) exhibitions, which have a startDate and EndDate 2) events, which have a date I need to grab the current exhibitions, future exhibitions and future events, which I do using this: {% ...
Clive Portman's user avatar
3 votes
1 answer
717 views

Output entries sorted by category title and paginate

I'm stuck on an issue where I have to paginate a list of entries that would be sorted by category title. So basically, I need to: fetch entries in the 'project' section sort those entries by the '...
Pierre Stoffe's user avatar
1 vote
1 answer
288 views

Multisort with supersort plugin

I have entries that I would like to sort by 2 fields. First I would like to sort (or group) all of the entries in alphabetical order by a category field (brand), and then within each grouped brand I ...
triplethreat23's user avatar
4 votes
2 answers
253 views

Method (plugin free?) to combine search results across multiple searches (and element types)

So I have created a combined search for products and entries using the new Craft 2.5 search score. It's working well, but...I was hoping to be able to do this without a plugin if possible ... but it ...
Jeremy Daalder's user avatar