sorting
Trouble creating a custom sort function for a CCK type
public
group: Views Developers
ultimike@drupal.org - Tue, 2008-07-08 19:56
Hello,
I'm trying to figure out the best way to use the Views (v1.x) API to create a custom sort function for a CCK type.
Here's what I have:
CCK fields:
- title (string)
- rating_a (int)
- rating_b (int)
- rating_c (int)
- rating_d (int)
I need to develop a way to sort the view by the average of a variable number of the "rating" CCK fields.
For example, if the user wants to sort the nodes only by "rating_a" and "rating_c", then the "order by" clause would look something like this:


