在 Drupal 6 视图 2 中显示单个节点和所有关联的注释
我正在尝试在 Drupal 6(视图 2)上创建一个视图,该视图仅显示特定类型的最新节点以及该节点的所有关联注释。
我确信有一种简单的方法可以做到这一点,但我只是不知道。
从算法上讲,我将通过确定该类型的最新节点然后递归其所有子节点来解决这个问题。但我显然不能这样做。
谢谢。
I am trying to create a view on Drupal 6 (views 2) that simply displays the latest node of a specific type and all of the associated comments from that node.
I am sure that there is a simple method to do this that I just don't know.
Algorithmically, I would solve it by ascertaining the latest node of the type and then recursing through all its children. But I can't apparently do that.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好消息!这并不难。 :)
创建一个将用作首页的视图。让它抓取并显示您想要的单个节点及其注释。然后,在过滤器下,选择节点:发布日期并执行大于 -1 且小于 +1 天的操作。
这是一个例子:
Basic settings
Name: Defaults
Title: None
Style: Unformatted
Row style: Fields
Use AJAX: No
Use pager: No
Items to display: 1
More link: No
Distinct: No
Access: Unrestricted
Caching: None
Exposed form in block: No
Header: None
Footer: None
Empty text: None
CSS class: None
Theme: Information
--
Relationships
None defined
--
Arguments
None defined
--
Fields
Node: Title Title
Node: Post date Post date
Node: Body
Node: Last comment time Last comment time
Node: Add comment link Add comment
Node: Comment count Comment count
Comment: Title
Comment: Author Author
Comment: Body
--
Sort criteria
None defined
--
Filters
Node: Post date > -1 day
Node: Post date
Good news! This is not so hard. :)
Create a view that you will use as your front page. Have it grab and display the single node that you want along with it's comments. Then, under filter, pick node: Post Date and do greater than -1 and less than +1 days.
Here's an example:
Basic settings
Name: Defaults
Title: None
Style: Unformatted
Row style: Fields
Use AJAX: No
Use pager: No
Items to display: 1
More link: No
Distinct: No
Access: Unrestricted
Caching: None
Exposed form in block: No
Header: None
Footer: None
Empty text: None
CSS class: None
Theme: Information
--
Relationships
None defined
--
Arguments
None defined
--
Fields
Node: Title Title
Node: Post date Post date
Node: Body
Node: Last comment time Last comment time
Node: Add comment link Add comment
Node: Comment count Comment count
Comment: Title
Comment: Author Author
Comment: Body
--
Sort criteria
None defined
--
Filters
Node: Post date > -1 day
Node: Post date