Drupal Views 将每个分类限制的最新内容显示到一个节点
我想创建一个视图,其中显示所有 5 个分类术语,然后显示最新发布的节点,但这受到 1 的限制。例如:
税收条款 1
最新节点发布税收术语 2
最新节点发布等等等等
目前我按分类术语分组,因此它显示所有已发布的节点,然后按发布日期降序排序。我不太清楚如何限制节点仅显示每个分类术语的一项。
任何帮助将不胜感激。
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 publishedTax Term 2
Latest node publishedetc 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这对于 Views 3 是可能的。我已经在 D7 上测试了这一点,但也应该在 D6 上工作。
This is possible with Views 3. I've tested this on D7, but should work on D6 also.
如果您有很多节点,那就不太好,但在其他情况下,我通过使用“升级到首页”过滤器来完成此操作 - 然后您只需确保一次仅升级一个节点即可。
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.
我建议使用面板和视图的组合。
首先,为采用分类术语作为参数的节点创建一个(或使用默认的)视图。其次,创建一个包含五个区域的面板页面。每个区域都将填充一个视图(事实上,它将是与第一步相同的视图,但具有不同的参数)。在面板 ui 中,您可以限制每个视图显示的条目数,将此值设置为 1 以便每个术语仅显示一篇文章。
面板:http://drupal.org/project/panels
浏览次数:http://drupal.org/project/views
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
我建议查看视图分组依据模块。
http://drupal.org/node/389230
上面列出的教程实际上几乎准确地描述了您的情况试图做。
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.