I would like to create a view displaying unique node types and providing links to create them. I know there may be other methods to provide this information, but it is a special case I'd like to implement using views.
I attempted to create a view with a single field: Node: Type and a single filter Node: Type in (selection here).
Additionally I set Distinct to Yes.
This resulted in:
SELECT DISTINCT(node.nid) AS nid, node.type AS node_type FROM node node WHERE node.type in ('burger', 'dessert', 'pasta', 'salad', 'sandwich', 'seafood', 'side', 'soup', 'sub', 'wrap', 'beverage', 'pizza', 'pizzaspecialty', 'franchise', 'pizza_crust', 'restaurant') GROUP BY nid
and displaying many of the same node types.
Of course this is due to DISTINCT(node.nid).
Is it possible in future releases of views that the Distinct option could be more configurable as to what should be distinct?
Comments
Comment #1
merlinofchaos commentedUnfortunately, no. In Drupal 7, it won't even be possible to use DISTINCT on anything other than the row.
In Views 3, what you want to do is use the group by functionality. Views 2 can't do this, though maybe the views_groupby module can help.