在视图中显示与其他类型不同的其他节点相关的那些节点的方法 [英] Way to display those nodes in a view that are related to any other node of a different type

查看:92
本文介绍了在视图中显示与其他类型不同的其他节点相关的那些节点的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两种内容类型-博客和新闻。我正在使用参考字段将博客节点与新闻节点相关联。现在,对于新闻登录页面,我需要一个显示相关博客的块视图,即它列出与任何新闻节点相关的博客。

I have two content types - "Blog" and "News". I am using a reference field to relate blog nodes to news nodes. Now, for the news landing page, I need a block view that displays "Related blogs" i.e. it lists blogs that are related to any news node.

新闻登录页面是一个带有主视图的面板页面,其中列出了所有新闻节点。 相关博客块将放置在主块下方。

The news landing page is a panel page with a main view that lists all news nodes. The "Related blogs" block will be placed below the main block.

是否可以使用视图来实现此相关博客块?

Is there a way to achieve this "Related blogs" block using views?

我正在使用Drupal7,我可以自由使用任何模块来建立关系,除了引用。

I am using Drupal7 and I am free to use any module for the relations, apart from references.

推荐答案

只需创建一个新视图,将引用字段添加为关系,并将NID添加为上下文过滤器。还将上下文过滤器设置为提供默认值,然后从URL中选择内容ID。将块添加到您的新闻页面。

Just create a new view, add the reference field as a relationship, and the NID as the contextual filter. Also set the contextual filter to Provide a default value and choose Content ID from URL. The add the block to your news pages.

这篇关于在视图中显示与其他类型不同的其他节点相关的那些节点的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆