It would be very handy to be able to sort the summaries by their counts, placing the most tagged arguments first (I'm using term name for this example). Currently, you can only sort summaries ascending or descending. It's difficult when using large vocabularies, because you have to limit the display, but then it cuts them off alphabetically. Let's say we limit to four items.
So instead of:
Apple (2)
Berry (1)
Banana (1)
Cantaloupe (4)
.... with the rest cut off
It could display:
Orange (12)
Cherry (10)
Watermelon (9)
Fig (8)
.... with the less common terms cut off
Imagine the possibilities when using as an attachment. Similar to faceted search...
One little checkbox that says "sort by Count instead of Argument name" would do the trick.
Just a thought. Thanks a ton!
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | sort_by_counts_views_3x.png | 164.98 KB | greggles |
| #2 | views_argument_summary_sortbycount.patch | 2.09 KB | recrit |
| #1 | views_argument_summary_sortbycount.patch | 2.09 KB | recrit |
Comments
Comment #1
recrit commentedRun the patch from /modules/views
This patch should also work on views 2.6 since no line numbers changed in views_handler_argument.inc from 2.6 to latest dev.
Comment #2
recrit commentedthis patch is still valid since views_handler_argument.inc has not changed in the latest dev. I am re-posting the patch and changing status to needs review. This works great to get a pareto view of taxonomy terms.
Comment #3
Mac Clemmens commentedThank you!
Comment #4
thekayra commentedWorks great. Thank you!
Comment #5
mnlund commentedPerfect! This should go in.
Comment #6
recrit commentedI agree it should go in. However, I had read some posts suggesting there was some work being done to make a more flexible aggregation with sum, count, etc. Hopefully that functionality is on the way.
Comment #7
maedi commentedJust what I was looking for, subscribing
Comment #8
merlinofchaos commentedCommitted to the 3.x branch.
Comment #9
maedi commentedJust to clarify, does this feature work in combination with CCK Multigroup module? I'm getting some weird counts "(1865) or (1858)" for all of my "ingredients". Though the list is correctly ordered ascending or descending by these seemingly unrelated numbers.
Comment #10
OpsCon.kt commentedI have installed the patch and do not see such sort options. Am I looking in the wrong place?
Comment #12
greggles@Maedi in #9, can you do a preview of your view where you see that problem? I see a similar issue and found that it is because the query is not generated correctly. My query is:
"SELECT term_node.tid AS term_node_tid, term_data.name AS term_data_name,
node.nid AS num_records
FROM ..."
node.nid AS num_recordsis where my "seemingly unrelated numbers" came from.@OpsCon.kt - you can use the 6.x-3.x-dev branch where this was applied if you are feeling adventurous, but it has some bugs. In general it should be in the overview of the settings for the Arguments. See attached screenshot for explanation.
Comment #13
gregglesTalked with dereine in irc - #705668: Glossary view returns unexpected results. is the issue that fixed this problem for me.
@Maedi - maybe it will fix the problem you found as well.