简体   繁体   English

Drupal-通过共同的价值链接两种内容类型

[英]Drupal- Link two content types by mutual value

I have two content types: man and food ; 我有两种内容类型: man food

The man content type contains the man's name several more fields and a unique id field created by the serial module. man内容类型包含man的姓名,其他几个字段以及由串行模块创建的唯一id字段。

The second content type is created by the users via an external form. 用户通过外部表单创建第二种内容类型。 The results from the form are set as the food content type. 表单的结果设置为food含量类型。 One of the fields is equal to the unique id field at the man content type. 字段之一等于man内容类型的唯一id字段。

My question is: I want to create a view that will show me all the man values, But when the value is clicked, it will lead me to a table that contains all the food content type entries where the unique id in food is equal to the man unique id value. 我的问题是:我想创建一个视图,将显示我的所有的man的价值观,但被点击的价值时,它会导致我一个包含所有的表food内容类型条目,其中的唯一ID food等于man唯一ID值。

It so easy to do this in php but I am new to drupal. 在php中这样做很容易,但是我对drupal还是陌生的。

Any help of lead will be great. 铅的任何帮助都会很棒。

You are talking about 2 different things (pages). 您正在谈论2种不同的事物(页面)。 Creating any of them isn't much of the problem, but you have to be more precise with your question. 创建它们中的任何一个都不是什么大问题,但是您必须更加精确地回答问题。

Basically, create first view which will just list all the users. 基本上,创建第一个视图将仅列出所有用户。 It will have link to second one with user id as parameter it passes. 它将链接到第二个链接,并以用户ID作为参数传递给它。

Create second view which will list all food nodes and add to it contextual filter for user id reference field and output will be narrowed only to food that is referencing user which id is passed. 创建第二个视图,该视图将列出所有食物节点,并向其中添加用户ID参考字段的上下文过滤器,并且输出将仅缩小到引用了ID的用户的食物。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM