Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ordering]

The tag has no usage guidance.

0
votes
0answers
18 views

Craft Commerce - Ability to create product options

We're hoping to develop a new ecommerce website for our client. They're a printing company (not the one referenced in the link). We'd like to develop on Craft Commerce but before we convince our ...
1
vote
0answers
28 views

Order entries by custom date field

I want to modify this query so that the dated entries are sorted in descending order on a custom field called 'startDate'. Have tried adding .order('startDate') to the end of the craft.entries(query)....
1
vote
1answer
22 views

Advanced sorting of events with database expressions (Solspace Calendar)

I want to do some complicated sorting of events coming back from the Solspace Calendar plugin. I'm not certain whether this issue is specific to this plugin or whether it's a general Craft thing. In ...
1
vote
0answers
34 views

How to sort entries of a timeline?

I am building a timeline which I want to paginate. For this to be efficient, the timeline entries should be in a linear order. The challenge is that entries before present (BP) have to be in ...
0
votes
0answers
30 views

Ordering search by score and a custom field

I've got a product search results page which works great and orders results by searchScore. However, I need to also allow for "priority" results based on a custom lightswitch field. I'm setting a '...
1
vote
1answer
34 views

SQL error when trying to use sortOrder on Matrix related block (Craft 2)

I'm getting the following SQL error when trying to simply order related entries in a Matrix block. Anyway around this? CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity ...
0
votes
1answer
47 views

How do I send PayPal the Craft Commerce Order Number?

The client is using PayPal Express for the payment gateway. When orders are placed, Paypal shows the ID for the order, not the Order Number. Is there somewhere I can change that?
1
vote
0answers
41 views

Order Entries by Category Fields (with fallback)

This is almost a duplicate of this question I have a section which I want to sort by category field. But the categories are not mandatory. When I apply |group('refSorter.first().title') it will ...
1
vote
1answer
162 views

Placing a Test Order (Craft Commerce)

This is a really basic question but I have had trouble finding an answer, or documentation on it. What is the best way to place a test order with a default Craft Commerce installation? I'm unable to ...
1
vote
2answers
106 views

Craft CMS - Dynamic Order Field Layout In Sections

I'm wanting to have the order of my elements within a template dynamic so that the user whilst in a template of page can reorder the modules as they please. See screenshot for example Within the ...
3
votes
3answers
56 views

Show time ordered entries from midnight at end of loop

I'm creating a line up listing page for a festival, across 4 nights. Acts are listed, per day, sorted by a date field in order of a start time field. The issue I'm having is that midnight until 3am ...
1
vote
1answer
136 views

Sort matrix blocks by date and limit to 10 entries

I'm loading multiple matrix blocks from multiple entries to the homepage if the date is today or in the future. So far this works but now I'm trying to sort the blocks by date and limit the output to ...
1
vote
1answer
73 views

Select query question

I am trying to do the following with craft.entries but I think it may not be possible without a plugin. I have 9 categories with related entries on all of them. I would like to get the latest ...
1
vote
1answer
138 views

Order a paginated entry by postDate

I'm stumped trying to order paginated entries for a channel. The end goal is to have listings with the most recent postDate at the top. The code below has the most recent item third instead of first. ...
1
vote
1answer
391 views

Entries order postDate not working

I'm trying to get prev/next entry using positionedAfter and positionedBefore filters but getting weird order on results because order('postDate desc') seems to be ignored. {% set prevSibling = craft....
1
vote
0answers
126 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
0answers
56 views

Ordering entries based on an eager-loaded element's custom field

I have a query that loads a set of movies, and eager-loads corresponding shows, which are related elements. For now, the movies are sorted by startingDate, which is a custom field in the movie entry: ...
1
vote
1answer
120 views

Sort entry titles alphabetically excluding 'The'?

I need to list the names of all of my entries in alphabetical order excluding 'the' (which could only be at the beginning). I've looked around online, but I was only able to find a code segment (which ...
1
vote
1answer
195 views

Sort products by category field value

All of my products have a category field called stateCat. These state categories have a field called stateImportance. This is because some states are more important than others and I want to sort the ...
1
vote
1answer
28 views

Disable ordering

I'm attempting to output a list of entries using slug names. When I do the following, the entries are automatically reordered in alphabetical (title) order. Same thing happens if I target the ID's ...
0
votes
1answer
59 views

How to get latest entries by particular field?

I have 4 fields in my section: -Images -Videos -GIFs -PNGs On my homepage, I have a section where I have to show 5 latest entries of Images, Videos, GIFs & PNGs. How can I do that ? I tried: ...
4
votes
1answer
127 views

Ordering Structure Sections with Structure Handles

I am using the code below to output a group of sections that have entries along with their section handle. How would I order the sections (ideally by structureId)? I'm not opposed to using supersort ...
3
votes
2answers
63 views

Another gallery question

I have looked around but cant find an answer to this. I have a structure for my gallery page, in-which there are three separate entries called A, B and C. There are different images within these ...
1
vote
2answers
111 views

Order entries, exclude 'the' from order criteria

I know this is partly a Twig question, but I've poked around quite a bit here, in Twig docs, Craft docs, and cannot find the right syntax. I have a bunch of entries with titles like: Hotel A Grand ...
1
vote
1answer
139 views

Ordering/sorting products by their variant stock level

I'm trying to implement a sort order in my product listings so that all of the out of stock products are last. I'm unsure how or if this is possible because the stock is set on the variants of a ...
3
votes
1answer
419 views

Order/sort a structure section by date too?

Is it possible to have a Structure section ordered by date (desc) as a default and then take the custom ordering in the CP into account?
1
vote
1answer
48 views

How can I do nested ordering?

I want to put the index of section in order by two fields: featured and startDate. Basically, I want the featured entries to rise to the top of the index, and then within the featured posts I want ...
2
votes
2answers
347 views

Order entries based on date field in the Control Panel

I have some entries and I want to order them in the Control Panel based on a date field of those entries. Is that possible ?
2
votes
0answers
143 views

Sort entries by related entry title

I’m trying to sort entries from a section called exhibitions by startDate and then by the title field of a related gallery entry. So exhibition entries with the same entry.startDate are ordered ...
1
vote
1answer
165 views

Yearly/Monthy archive listing sorted by month

I've got a list of entries grouped by year which is working correctly except that the months are being output in the the reverse order. This code outputs the years in the correct order but the months ...
1
vote
0answers
71 views

Different order per locale for Structures

I know this is a long shot, but is there a way to order a Structure differently per locale? As in the standard drag and drop ordering that comes with a structure but with the ordering saved for each ...
2
votes
2answers
123 views

How can I order a sections entries by their children entry postDate?

Is it possible to order a section of entries by their child entries post date? {% for article in craft.entries({ section: 'articles', type: 'videoArticle', limit: 6 }).getChildren().order(...
1
vote
1answer
132 views

Sorting across blocks (to get prev/next links)

issue is an entry that has a matrix field named contents, whose blocks have an entries field named works, and the related works channel has an entries field named authorPeople. Issue 1's contents ...
1
vote
1answer
241 views

Ordering relatedTo entries

There are a few tickets touching on this, but the solutions proposed aren't working and I'd like to share the use case: I have a Table of Contents page that is outputting a set of entries based on an ...
2
votes
1answer
47 views

Hide users without profile pics

I'm working on a site that has logins for members, but I'd like to have a page that shows all members with a name and picture. To do this, we had to import an existing database that doesn't have a lot ...
1
vote
1answer
254 views

Order by related entries count

I have a channel with a related users field. I want to output all channel entries ordered by the number of related users, this is what i have so far: {% set entries = craft.entries.find({ ...
1
vote
1answer
86 views

Changing the order of an 'archive' page

I'm creating a monthly archive page (for a specified year) for a section. Standard code to output the months and entries as follows: {% set entriesInYear = craft.entries.section('blog').limit(null)....
4
votes
1answer
376 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
109 views

Set Parameters from User Input

Is there a way to set parameters from front-end user input? Let's say I have a page that displays a list of entries. On that page, I have a form select called paidStatus with options notReceived, ...
1
vote
1answer
448 views

Loop through entries with custom ordering, showing one from each category then start loop again

I have a channel with entries that may or may not have a custom date field populated. I'd like the display a list of entries, looping through each category, showing one entry from each category. Then ...
1
vote
1answer
74 views

Unable to sort large number of blocks in Matrix field in CP and template

I have about 145 blocks in a single Matrix. If I try and re-arrange (drag&drop) the first few blocks, and then hit save, all is well. However, trying to re-arrange the last few blocks doesn't save ...
0
votes
1answer
169 views

Order merged query by shared field

I’m trying to merge two query sources (some entries and some categories) but have them ordered by a shared field that is a date field. Here’s what I have so far: set classesLocations = craft.entries....
2
votes
1answer
340 views

Order Entries in a Section by Category Titles

I currently have entries from a section output simply using a variable like: {% set beer = craft.entries.section('beverages') %} All of the beer entries have brands assigned to them using the ...
2
votes
1answer
78 views

Output tags in the order they were added to an entry

Is it possible to output tags for an entry page in the order they were added to related entry? For example on a News page I would like to output any/all tags added to the News article on the specific ...
2
votes
1answer
1k views

Sort / Order Entries on select or button click

I have a page on my website were I display alot of entries. Now I want those entries to be sorted by Date, Title etc. I know how to change that hard coded but I want to make it dynamic with a <...
0
votes
1answer
404 views

Is it possible to reorder fields with drag and drop?

I'm trying to understand how most people deal with this likely common issue, I've been looking around for answers, apologies if this is a subjective question, but I imagine there is a 'correct way' of ...
0
votes
1answer
139 views

Change field arrangement from the entries page

In ExpressionEngine you can rearrange the field types from inside the entry. I was wondering if there was any feature like this in Craft? I've got a lot of different types of entries so it's a pain to ...
1
vote
1answer
59 views

Entries Related by Category with Filler Entries After

At the bottom of an entry I want to display links for eight other posts. To make this useful, what I'd like to do is: start with entries that are related to the post currently being viewed by ...
3
votes
2answers
2k views

How Do I group entries by Category and retain fixed Category Order?

I found a solution to grouping entries by category here which is working perfectly but I need the categories in the order they were arranged in the categories tab in the Admin panel. Currently, the ...
1
vote
1answer
107 views

Display entries tagged with specific tag(s) before other entries

What I'm trying to accomplish is looping through a collection of entries and have them display (with pagination) in the following order: entries tagged as Featured in alphabetical (title) order ...