Hi,
It is probably easiest to describe my feature request by my own example where it would be needed. I'm a Views novice, so perhaps there's some other way to accomplish this already in Views--but here goes:
I have a CCK text field named field_priority. It has 5 key|label values to select from:
2|High
5|Medium
7|Low
9|null (default)
10|Complete
I want to sort using the KEY values(since alphabetical sort of labels would give you Complete-High-Low-Medium which is not desirable) instead of the LABEL. Unfortunately, I can only sort with "Content - field_priority" using the labels apparently. Since CCK fields with key|label are pretty ubiquitous(i think??), this feature should be added to Views.
I was able to resolve my problem by creating a second Computed Field named field_priority_sort which computes and returns the KEY instead of the value, and I can sort using that fine-- but it would have been very cool if sorting by KEYS was already native to Views.
Thanks.
Patrick
Comments
Comment #1
merlinofchaos commentedComment #2
yched commentedOnly the keys are stored in the db. Views sorts being SQL sorts, it is only possible to sort according to the keys.