Questions tagged [sort]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
21 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
26 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
16 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
119 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
93 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
61 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
511 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
528 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
1k 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
156 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
67 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
131 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
90 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
713 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
137 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
438 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
212 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
229 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 ...