Questions tagged [sort]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
47 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 ...
1
vote
1answer
54 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 ...
0
votes
0answers
10 views

Sort entry query by their table of values if said values are in a separate array of values

Morning (in the UK at least) - I'm trying to sort/order/filter an entry query by an array of values. The array is a list of IDs (e.g. [2,7,8]), and inside each entry is a table with a list of IDs that ...
1
vote
1answer
33 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 %} {% ...
0
votes
0answers
41 views

Customizing display order of category entries to match admin (order as Structure)

I'm working on a Craft-based site that has a category defined for "Members". I can see in the admin panel one has the ability to drag the entries for this category in any arbitrary order (when ...
1
vote
1answer
20 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' }, { '...
1
vote
2answers
156 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|...
1
vote
1answer
268 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?
1
vote
1answer
94 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(...
2
votes
2answers
633 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 ...
3
votes
1answer
913 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 ...
0
votes
1answer
2k 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 ...
1
vote
0answers
177 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 ...
1
vote
1answer
84 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('...
1
vote
1answer
147 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 ...
0
votes
1answer
94 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. ...
2
votes
1answer
802 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. {% ...
2
votes
1answer
139 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: {% ...
3
votes
1answer
475 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 '...
1
vote
1answer
234 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 ...
4
votes
2answers
233 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 ...