[英]drupal multiple content type reference
Drupal has content types set as: Drupal的内容类型设置为:
- Book
- Contributor
Custom CCK fields are added to above content types. 自定义CCK字段已添加到上述内容类型。
Contributor has type id set as: 参与者将类型ID设置为:
- Author
- Seller
- Reader
The above contributor type id is to be added (currently with node reference) to "Book" with Author and contrition typpe "Seller". 将使用作者和贡献类型“卖方”将上述贡献者类型id添加到“ Book”(当前带有节点引用)。
example: 例:
Book Contributor Contributor Type
-------------------------------- -------------- ---------------
Act Like a Lady, Think Like a Man Steve Harvey Atuhor
Act Like a Lady, Think Like a Man Steve Harvey Seller
The Alchemist Paulo Coelho Reader
The Happiness Project Gretchen Rubin Atuhor
The Happiness Project Gretchen Rubin Seller
What would the best approach to achieve this. 什么是实现这一目标的最佳方法? With current setup we are able to add contributor id, how to add "contributor type" with it as well.
使用当前设置,我们能够添加贡献者ID,以及如何添加“贡献者类型”。
If I understand you correctly 如果我理解正确
Book
and Contributor
Book
和Contributor
Book
content type has a node reference field which points to nodes of type Contributor
Book
内容类型具有一个节点引用字段,该字段指向Contributor
类型的节点 Actually your question, if I have understood correctly is a good one. 实际上,如果我理解正确,那么您的问题就是一个好问题。 The answer is not trivial.You need to somehow "group" the node reference field with a select list.
答案不平凡。您需要以某种方式将节点引用字段与选择列表“分组”。 This way every time you make a node reference, you also select the contributor type.
这样, 每次您创建节点引用时,您还可以选择参与者类型。 What you're asking for essentially is "Multigroup" feature.
您实际上要求的是“多组”功能。 Its available only in CCK version 3.You cannot do this with CCK Version 2 series which is what you're probably using.
它仅在CCK版本3中可用。您可能无法使用CCK版本2系列执行此操作。 Unfortunately a stable version 3 of CCK is still not available.
不幸的是,CCK的稳定版本3仍然不可用。 However a development is available at http://drupal.org/node/484068 .
但是,可以从http://drupal.org/node/484068进行开发。 As of today, a lot people are using this version already (see http://drupal.org/project/usage/484068 ) and from what I've read, its quite stable already.
到今天为止,已经有很多人在使用此版本(请参阅http://drupal.org/project/usage/484068 ),据我所读,它已经相当稳定。
So in summary: 因此,总而言之:
sites/all/modules
folder. sites/all/modules
文件夹中安装CCK 3.x-dev。 Remove the CCK 2.x folder if it exists there. MG
. MG
。 You can do this under Manage fields -> Add a New group (Select Multigroup
from the dropdown) Multigroup
组) Link to Contributor
. Link to Contributor
。 Make sure the parent of Link to Contributor
is MG
(you can achieve this by grabbing the anchor and moving the field to the right, just like you do for a hierarchical taxonomy tree. Link to Contributor
的父级是MG
(您可以通过抓住锚点并将字段向右移动来实现此目的,就像处理分层分类法树一样。 Contributor Type
. Contributor Type
。 Again, make sure the parent is MG
. MG
。 Book
. Book
类型的节点来进行测试。 You will be able to select the Contributor and the Contributor Type. book
, simply press the Add More Values
in the Node Edit Form. book
,只需在“节点编辑”表单中按“ Add More Values
”即可。 And BTW since I found your question interesting, I've tried it out and it seems to work correctly for me! 顺便说一句,因为我发现您的问题很有趣,所以我尝试了一下,看来它对我来说是正确的!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.