问题
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:
Outside Views, this appears to be exactly what Taxonews.module does. HAve you considered it ?
(disclaimer: I'm its author)
回答2:
(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 !
回答3:
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.
回答4:
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!
回答5:
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.
The tutorial is available at: http://vimeo.com/6547042
You've given a good start in direction many on the web dependents would like to step onto.
来源:https://stackoverflow.com/questions/1177875/drupal-6-views-listing-taxonomy-terms-with-tagged-nodes-underneath