Drupal Views display newest content per taxonomy l

2019-04-13 09:26发布

I want to create a view where all 5 of my taxonomy terms are displayed and it then displays the latest node published but this is limited by 1. For Example:

Tax Term 1
Latest node published

Tax Term 2
Latest node published

etc etc

Currently I'm grouping by taxonomy term so it's displaying all nodes published then sorted by published date desc. I can't quite figure out how to limit the nodes to only show one item per taxonomy term.

Any help would be greatly appreciated.

4条回答
啃猪蹄的小仙女
2楼-- · 2019-04-13 09:37

It's not great if you have a lot of nodes, but I've done this in other cases by using a filter for "Promoted to front page" - then you simple make sure you only promote one node at a time.

查看更多
看我几分像从前
3楼-- · 2019-04-13 09:38

This is possible with Views 3. I've tested this on D7, but should work on D6 also.

  1. Add a new view of type - Taxonomy terms
  2. Add relationship - Taxonomy term: Representative node
  3. Other - Use aggregation: Yes
  4. Add field - Content: Title. Change Aggregation settings to Group results together
查看更多
forever°为你锁心
4楼-- · 2019-04-13 09:45

I'd suggest to use a combination of panels ans views. First, create a (or use the default) view for nodes which takes a taxonomy term as argument. Second, create a panels page containing five regions. Each region is to be filled with a view (in fact it's going to be the same view from step one, but with different arguments). Within panels ui you can restrict the number of shown entries of each view, set this value to one to have only one article be shown per term.

Panels: http://drupal.org/project/panels

Views: http://drupal.org/project/views

查看更多
Luminary・发光体
5楼-- · 2019-04-13 09:52

I'd recommend checking out the Views Group By module.

http://drupal.org/node/389230

The tutorial listed above actually describes almost exactly what you are trying to do.

查看更多
登录 后发表回答