Hi
I'm having problems ordering a view output by taxonomy terms.
I have nodes with different vocabularies applyed to them:
- Year
- Genre
- Etc...
and I would like to order the view output by year. It seems I can't order it directly by "Taxonomy: Terms for Year", the option doesn't appear.
But I can order it by "Taxonomy: Term Name", so I did. I assume it is actually ordering by all the terms applyed to a node and the order of this terms will be asigned by vocabulary weight. I've checked that "Year" vocabulary has the lowest weight (actually its -10 like "Forum" wich can't be modified).
Then, when I see my view, here is an example of what I get:
1989 Rick Dangerous
1992 Wolfchild
1991 Chuck Rock
1990 Rick Dangerous 2
1990 Monty Python's flying circus
Wich is not ordered by year, neither upward nor downward.
What's happening here? Is order by "Taxonomy: Term Name" actually counting some kind of points on nodes to order them? I mean:
Order of term in vocabulary A +
Order of term in vocabulary B +
...
In this case, there could happens this kind of issue:
node 1
Vocabulary A - Term 5: 5 points
Vocabulary B - Term 2: 2 points
-------------------------------
Total points: 7
node 2
Vocabulary A - Term 4: 4 points
Vocabulary B - Term 4: 4 points
------------------------------
Total points: 8
So, in this example, node 2 should be shown after node 1 because it has lower punctuation in the main vocabulary (A) but actually is displayed in first place.
Is there any kind of workaround or "real" solution to order a view by a numeric vocabulary?
Thanks in advance.
Comments
Comment #1
sunSorry, unfortunately this support request is way too specific. Please have a look at the issue queue - Views maintainers are buried already. You might want to try to get further support at http://drupal.org/support. Additionally, the answer to your question might be covered in the handbooks at http://drupal.org/handbook/modules/views already.
If you were able to solve this issue on your own in the meantime, you might want to add the involved steps to this closed issue, so other users searching for a similar solution might find it.
Comment #2
kadrianus commentedAny chance to order nodes by taxonomy weight? (months, astrological signs, etc) Actually I can order by taxonomy term name, but it can be an unnatural way in some circumstances.
Comment #3
NoRandom commentedAfter a long time I've found a workaround for this issue. Currently it works in Drupal 6 but I think it can also work in Drupal 5. Also I'm working with a numeric vocabulary (years in my case: 1945, 1946, etc...) but you can use whatever function you want to add numeric values to your text terms.
The steps are:
Main problem, for me, is you need to manually edit->save your nodes to get computed field updated. There is a views submodule called "Views Bulk Operations (VBO)" wich could do this task automatically but I haven't been able to make it work.
Minor second issue is you can see "duplicate" data if you keep node revisions and use "diff" module to see their differences (only applies to Drupal 6). i.e. You have:
term_year: 1943 => computed_field: 1943, you edit the node and change to term_year: 1945 => computed_field: 1945, then in the diff page you'll see two changes
Regards.