Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
6.x-2.8
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Nov 2007 at 08:09 UTC
Updated:
15 Aug 2010 at 06:20 UTC
I'd like to filter by a particular vocabulary that has multiple terms. I'd like the view to only show, for example, the most recent node from each term associated with that vocabulary. Currently, it appears that the only way to do this would be to create separate views for each term and then use views fusion to combine them. But this is rather tedious and creates a lot of extra work if one has very many terms, and then there are so many extra views to manage. if this could be done within one view, it would be awesome.
Comments
Comment #1
merlinofchaos commentedIt would be awesome.
Alas, it is simply not possible with the current architecture.
Comment #2
cpelham commentedMerlin, might it be possible in Views 2?
If this feature might get added in next year, I could wait for it. Otherwise, I'll just go ahead and use Views Fusion.
Comment #3
merlinofchaos commentedI don't think so, because of the way SQL works, it's hard to do a limit per group; you can only do overall limits or group down to 1. I can't really think of a way to do it in one query, and Views basically wants it done in a single query.
Comment #4
davoso commentedHi, i'm new in drupal, but i think views is by far one of the best modules (of those i saw so far).
I asked the same question (but i work with views 2), for solve your question, i did a style plugin, here is an implementation to group the results of the query (render_grouping method), and in the options of the new style i added a new field (number of items per group) but this works only if the items per page is unlimited because this function is called with only the number of rows in items per page.
good:
- You have a limit per group (more less, only you can group by one field).
bad:
- you have to ensure your query don't have to much items.
- you have to use that plugin (or probably you could modify views module code (views_plugin_style class) ).
Comment #5
dawehnerthis is won't fixed, its quite impossible to do it with sql
Comment #6
Oscar Illada commentedI was looking for the same solution, i see that a lot of month pass away and nothing was done, if some one have the answer let me know.
Thanx and Drupal RULESSSSSSSSSSSSSS, greetings from Uruguay
Comment #7
xjmSee #4. It doesn't have to be done in SQL; it can be done with a style plugin. davoso, might it be possible to post your plugin in this issue as others might find it useful?
Comment #8
mr.andrey commentedI'm actually very interested in figuring out a way to show the top three entries for each of the users.
What if we do a PHP argument that pulls only the top three nodes for each user (of a particular role)?
I have a query that almost does this, but I can't get it to sort correctly.
Here's the basic idea:
The basic principle is that we add a dynamic counter column, which resets on every new uid.
Add a "HAVING i <= 3" statement, and it should pull the top three results.
Now this is the version with limiting by role:
... and this is what I get:
Unfortunately if I use the INNER JOIN, I can't get the "i" counter to assign as in the first query. It pulls the lower number nids first, rather than the highest as ORDER BY statement specifies.
Any ideas?
Best,
Andrey.
Comment #9
esmerel commentedNo patch, no activity in 3 months.