Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.9
Component:
page displays
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2011 at 15:46 UTC
Updated:
6 Mar 2012 at 21:42 UTC
Hello,
I have a view. The style is HTML List (unordered). The Grouping field is set to a CCK content field.
The CCK Content field is a select list with three items. My question is: what determines the sort order of the groups?
The select list used to have two options.
Hot
Not
I added a third to the top.
Very Hot
Hot
Not
The view ordered the groups as:
Hot
Very Hot
Not
Which is neither in alphabetical order nor the order they are listed in the select list. I'd like to know how Views determines the order in which the groups appear, and if that can be adjusted somehow. Any assistance would be greatly appreciated.
Comments
Comment #1
merlinofchaos commentedGroups are sorted in the order they appear in the resultset.
It is often a good idea to use the grouping field as part of the sort, if you can, to ensure that the groups sort the way you like.
For exmple, let's say I'm doing a view, grouping on node type, and I come up with a resultset that looks like this, sorted by nid:
Then the groups would be in this order: story, page, article --
Comment #2
mehoo462 commentedPerfect! Thank you.
Comment #4
Cablestein commentedI have the same issue.
This module can give you some control of the sorting of field groups:
http://drupal.org/project/views_groupby
After some tinkering, I had my groups in the order I needed.