我正在电影网站上工作,我有两种内容类型,“电影”和“电影评论”。 我想制作一个视图(使用视图模块),向我展示与电影相关的所有“电影评论”。
我需要抓住所有“标题”cck字段中具有相同内容的“电影评论”作为当前“电影”节点的标题。
即如果我正在观看“马达加斯加”电影节点,我需要在标题中获得所有带有“马达加斯加”的电影评论。
可以这样做吗?
I'm working on a movie website and I have two content types, "Movies" and "Movie reviews". I want to make a view (using the views module) that shows me all of the "Movie Reviews" related to a movie.
I need to grab all the "Movie Reviews" that have the same content in the "Title" cck field as the title of the current "Movie" Node.
i.e. if I am viewing the "Madagascar" Movie node, I need to get all of the Movie Reviews with "Madagascar" in the title.
Can this be done?
最满意答案
您最好使用实体引用字段。
安装此http://drupal.org/project/entityreference 将实体引用字段添加到引用电影内容类型的审阅内容类型。 创建一个显示评论列表的新视图。 添加一个上下文过滤器,选择影片字段,其中显示“WHEN”过滤器值不可用“选择提供默认值 - > URL中的内容ID。如果您创建了带有块的视图,则可以在电影页面上看到该块,并且它应该只显示链接到该电影的评论
You would be better off using an entity reference field.
Install this http://drupal.org/project/entityreference Add an entity reference field to your review content type that references the movie content type. Create a new view displaying a list of reviews. Add a contextual filter selecting the movie field, where it says "WHEN "THE FILTER VALUE IS NOT AVAILABLE" select Provide default value -> Content ID from URL.If you have created the view with a block place the block so it can be seen on the movie page and it should only display reviews linked to that movie
更多推荐
发布评论