我无法弄清楚如何在Drupal 7中链接2个内容类型之间的字段。例如......
我正在使用Drupal 7构建在线商店。有几个产品类别,每个类别都有自己的页面,显示该类别中的所有产品以及类别说明。
我将这些数据存储在两个表(内容类型)中。见下文。
categories content-type:
category_name, description
----------------------------------------------
paintings, "A selection of paintings that we supply. Prices include ...."
ceramics, ....
jewellery, ....
products content-type:
name, category_name, price, ...
---------------------------------------------------
mona-lisa, paintings, £10,
necklace1, jewellery, £20,
necklace2, jewellery, £30,
公共字段是'category_name'。在第一个表中,我定义了category_name的所有值,在第二个表中,每次添加新产品时,我希望能够选择一个类别来分配给产品。有谁知道怎么做?
您可以在内容类型之间重复使用字段,但无法更改窗口小部件类型(“类别”内容类型需要自由文本输入,“产品”内容类型需要选择器。
在Drupal 6中,似乎有一个'节点参考'字段类型,这可能是我正在寻找的但我无法弄清楚如何在Drupal7中获得它。