在Drupal 6中,有没有办法将自定义字段从最新帖子转到分类术语,并在视图中显示?

在Drupal 6中,有没有办法将自定义字段从最新帖子转到分类术语,并在视图中显示?

问题描述:

The title for this question pretty much sums up what I'm asking.

I've got a list of taxonomy terms, and I'm using a view to display the latest post to each one. I'd like to also display a custom field set up in CCK just under this.

Currently, I'm just using "date updated" of the taxonomy term itself which was easy to set up in views. I'd like to drill a little deeper and get the custom "event date" field I've added to the content type last posted to the taxonomy term I'm "viewing".

I've got a feeling I'm going to have to write my own database query for this.

If (I can avoid that){ How do I set up such a view? } Else{ What's the best practice for including lower level database queries alongside views? }

这个问题的标题几乎总结了我的要求。 p>

目前,我只是使用分类术语本身的“更新日期”,这很容易设置 在视图中。 我想深入钻取并获得自定义的“事件日期”字段,我已添加到上次发布到我正在“查看”的分类术语中的内容类型。 p>

我有一种感觉,我将不得不为此编写自己的数据库查询。 p>

如果(我可以避免){ 如何设置这样的视图? } Ellse { 什么是将低级数据库查询与视图一起包含的最佳做法? } p> div>

what about using row style instead of node style for your view, and building the desired look of the view with a custom module? this would let you send the fields you want to the page and then theme them however you wish.

See this issue on drupal.org: http://drupal.org/node/193187. Technically, SQL does not allow you do a grouped query and set a limit per group. It would be possible to execute a grouped query and only display the first of each group on the theme level. However, depending on the number of nodes, that might not perform too well - I'm not sure.