option to aggregate results to top level taxonomy term
seutje - April 7, 2009 - 10:57
| Project: | Views Cloud |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Description
hey there, I figured it would be nice to use this module for my taxonomy term view, but I noticed that using the following term structure:
term1
term2
- subterm1
- subterm2
- subterm3
term3where term1, term3 and subterm1 have content, it shows those 3 in my cloud instead of term1, term2 and term3
so I will try to hack this module a bit and come up with a sensible patch with like a checkbox for "these are texonomy terms and I want you to use to top level one"
or would this be a wrong sort of approach? should I be changing the way the summary results are built instead?

#1
posted in wrong issue queue
#2
*patched*
was remarkably easy, thanks for keeping a clean code, feel free to rape this patch if you think anything should be done some other way
so basically this will add an option to the cloud settings entitled 'Taxonomy: use top level terms' - 'Checking this box will make use the system assume it's dealing with taxonomy terms and it will aggregate results to the top level term.'
when that box is checked, it will try to find the top parent for each result, replace each child with that parent, check for duplicates, aggregate results from duplicates and delete leftovers
#3
shows top terms twice when 2 child terms have nodes
#4
changed it a bit to aggregate the count and delete duplicates properly
#5
sizes don't seem to be accurate when aggregating terms to their top level parent
not a priority in current project, will look into it when I have time available
#6
#7
This patch doesn't seem appropriate to this project. Instead it should be a self-standing argument that can be used with or without Views Cloud. It's a perfectly reasonable request to have a list of top-level taxonomy terms in a listing, without a cloud at all.