Played around with the taxonomy table views for the first time yesterday.

What would be very very lovely is if there was a 'node count' filter with an option for number of nodes associated with each term. Then it'd easy to view defunct/unpopular terms and/or exclude them easily from results. This has a bit of overlap with tagadelic (especially if extended to sorts and the rest), so won't fix if so, but worth asking.

Not to scope creep my own issue, but 'edit' links for taxonomy terms would make this kind of thing useful for eventually replacing the term administration pages.

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

You can get this with a summary view (kind of, not the filter part); right now, core Views doesn't support much in the way of group by which is what would be required to do this. It's a very large bag of worms and it needs to be thought out properly before it can be put in, and it's something I didn't really consider in too much detail with the rewrite; I've thought about it but I have not mentally solved all of the problems required in order to actually do it.

So alas, Views won't be seeing this feature any time soon.

ñull’s picture

Status: Closed (won't fix) » Active

Subscribing.

In Taxonomy menu you had this option to show only terms that had any nodes. It is pretty useless to have a list of terms when there are no nodes associated. Please reconsider a simple filter just testing the presence of nodes.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

I love it when people re-open stuff after I've explained why it's closed. I provide a technical reason why it can't happen, and they respond with a purely philosophical reason.

right now, core Views doesn't support much in the way of group by which is what would be required to do this. It's a very large bag of worms and it needs to be thought out properly before it can be put in,

Only re-open issues like this if you can solve the technical issues. Otherwise you just sound demanding.

Please reconsider a simple filter just testing the presence of nodes.

Do you think if it were simple I would have said what I did?

sandfurz’s picture

I think, I'll just write a small module which:
- adds a new column "node_count" to table "term_data"
- counts existing term-node-relationships during install and updates "node_count" respectively
- creates an insert / delete trigger on table "term_node", incrementing / decrementing the related count column in "term_data"
- adds handlers (field, filter, etc.) for our new column to view's term-base-table via hook_view_data_alter.

... would also be much more database-friendly than COUNTing, GROUPing, and stuff like that.

what's your feeling about that? :-)

dawehner’s picture

I did the same for og statistics, but i think its definitve better to add another table, so it has not to be loaded everytime and your table schema does not change.

sandfurz’s picture

yep!
You did it with SQL triggers or some kind of insert/delete hook?
Triggers appear more "slim" to me than issuing any extra queries via drupal, but they also require an update of core tables.

nicks’s picture

It looks to me like this problem is already solved by the Term Node Count module, which uses a table to track term node counts (as suggested by sandfurz), and then exposes this to Views as a field.