relations variable of content-type drupal 7

送分小仙女□ 提交于 2020-01-06 15:53:32

问题


I have created a content type called Customer.

I am creating other content called reports.

A customer has several reports.

How could create a variable in the content-type reports relations with the customer's name on content-type customer?

thanks


回答1:


You should use Drupal Entity Reference module. Download, install and enable it, and then, you have to add a new field in content type "Reports", namely customer, of type "Entity reference" (this field type was added by Entity Reference module). Once you have added this field, you have to choose which kind of nodes can be referenced. Select Customer in the checkbox list.

You can also choose the way you want to determine which customer owns a report. You have several options: selection checkboxes, autocomplete field, etc. Take a second to determine if a Report should be linked to one or more customers. In case it must be linked to a single customer, make sure to limit the number of fields to one.

Using this module you will not only link the customer's name to the report, but you will also link the whole entity. You will be able to display the customer name as a link to the customer node.



来源:https://stackoverflow.com/questions/30007937/relations-variable-of-content-type-drupal-7

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!