views:

3979

answers:

6

I need to create a view that lists out taxonomy terms and then list the top 3 recent(sort by node:date updated) nodes with that tag

example out put:

Article

  • Article 1
  • Article 2
  • Article 3

Podcast

  • Podcast 1
  • Podcast 2
  • Podcast 3

. . .

I created a view of type "Term" and I can get the view to output all of the terms. However, I don't see how to link in the nodes tagged with the taxonomy term. I looked around in the view of type node, but I couldn't get anywhere close to what I needed to output.

+1  A: 

(Only the first part of a possible solution -- maybe it'll help you get to the full solution)

What about a view "node", with something like that (I use Drupal in French, so it might not always be the right words, sorry) :

  • fields
    • Taxonomy : term
    • Node : title (as link to node)
  • filters
    • whatever you want ^^
  • sorting
    • whatever you want
  • on the left of the screen, "base parameters" or something like this:
    • style : HTML list (or table)
    • the little "wheel icon" on the right of "style" : when you click on it, you have to possibility to choose, in a select list, a "grouping field" ; select "taxonomy: term"

It should list the nodes, grouped by taxonomy terms.

The only thing I don't know is how to list only 3 nodes of each taxonomy term ; if you do find out, I'm interested !

Pascal MARTIN
Yeah that get's closer, but you can't put a limit on each group by. The other thing I'm thinking about doing(super hacky) is making another view that just lists 5 most recent by term(via arguement) and then use the output of the view I made(outputs all the terms of the vocab) and manually calling the view in a *.tpl.php page
easement
I've done that once ; but I don't like the idea ; didn't find a better way either :-( (except I didn't call it the the .tpl.php, but in template.php)
Pascal MARTIN
+1  A: 

You could do this pretty easily with panels. Actually panels is not needed but it's a nice module that let you do a lot of stuff. Basically you can create a view for each term and make a blok display. In panels you can then create a page where you can put all of the bloks. You could also put the bloks in the content area only to be displayed in an empty page but that is in many ways not as elegant.

googletorp
+1  A: 

Outside Views, this appears to be exactly what Taxonews.module does. HAve you considered it ?

(disclaimer: I'm its author)

FGM
This gets me close. However, the taxonomy terms can be added by someone who doesn't have privileges to place blocks on the page. However, this answer should satisfy anyone who is looking.
easement
A: 

hi Martin & co!

if you still wander how to finish you recipe for taxonomy view

you may like the video tutorial on topic of drupal calendar

which uses exactly the technique needed to complete displaying the terms

you can watch it at http://vimeo.com/6547042

well , you've given a good start in direction many on the web dependents would like to step onto

cheers Ed

ed weglowski
A: 

Or you can create a term view and add the node into the relationships, then you get all the nodes with a term, and as above, display as list and group according to term (with exclude from display). If you have as your primary sort Taxonomy by weight you can control the order of the grouping (something I couldn't do with a normal node view), then you could display in the order you want.

All that said, can't see how to limit it to 3 nodes per category!

Alex
A: 

@Alex: For some reason the add relationships dialog is not showing options for nodes. I currently have a view listing all of the Taxonomy terms with a filter on the vocabulary. What else do I need to do to get node fields to show up in the relationships?

hgcrpd
Nevermind, I managed to do it with Pascal Martin's technique.
hgcrpd