Skip to main content

Views: Taxonomy Term View: Display only one node per taxonomy term.

Today I was setting up a website that was using FlickrSync to pull images from Flickr. FlickrSync creates one node per image and uses Flickr's tags as taxonomy terms. Perfect.

I created a new Term view to pull all taxonomy terms associated to the 'Gallery' vocabulary I had created. The problem I ran into was that the view pulled ALL image nodes tagged with each gallery term. This was not what I was looking for. Instead, I wanted a list of each term and one image node, not all nodes.

The first thing I tried was set the view to only grab DISTINCT items, but since this was a term view, this didn't work. After searching a bit I finally found the solution. You can achieve one node per term in a view by using the views relationship: Taxonomy term: Representative node. This relationship will allow you to select one node per taxonomy term.

Done!


Comments