[英]How do you configure views block based on node reference in Drupal 8/9?
There is a node pages that holds reference fields of the taxonomies (course type and semester).有一个节点页面包含分类法的参考字段(课程类型和学期)。 For example:
例如:
There is a node courses that holds reference fields of the taxonomies.有一个节点课程包含分类法的参考字段。 For example:
例如:
I need to somehow get those courses on the page that both reference the same course type and semester我需要以某种方式在页面上获取那些引用相同课程类型和学期的课程
I figured I could create a views block and place that on all pages that have course type and semester defined.我想我可以创建一个视图块并将其放置在所有定义了课程类型和学期的页面上。 But I can't figure out how to configure the View to correctly filter the courses.
但我无法弄清楚如何配置视图以正确过滤课程。 Any help would be greatly appreciated!!
任何帮助将不胜感激!!
Both the "page" and "course" content type must be using the same fields for referencing the course type and semester . “页面”和“课程”内容类型必须使用相同的字段来引用课程类型和学期。
On the view settings page (admin/structure/views/settings) there is a setting for "Show the SQL query" which is helpful to see the SQL query on the preview在视图设置页面 (admin/structure/views/settings) 上有一个“显示 SQL 查询”的设置,这有助于在预览中查看 SQL 查询
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.