Drupal 7 来自tid的节点id

Drupal 7 来自tid的节点id,drupal-7,taxonomy,Drupal 7,Taxonomy,如何从tid获取nid,这样我就可以使用node_load函数,然后使用Field_get_项来获取特定的字段。我首先使用了taxonomy\u select\u node,但它为我提供了与该tid相关的所有节点的NID,但我需要特定bundlecontent类型的NID,因此我只能显示该内容类型的内容。现在我正在使用Entityfieldquery,下面是我的代码: ifisset$\u获取['tid']{ $id=$_GET['tid']; $query=新实体字段查询; $query->e

如何从tid获取nid,这样我就可以使用node_load函数,然后使用Field_get_项来获取特定的字段。我首先使用了taxonomy\u select\u node,但它为我提供了与该tid相关的所有节点的NID,但我需要特定bundlecontent类型的NID,因此我只能显示该内容类型的内容。现在我正在使用Entityfieldquery,下面是我的代码: ifisset$\u获取['tid']{ $id=$_GET['tid']; $query=新实体字段查询; $query->entityCondition'entity_type','node'; $query->entityCondition'bundle'、'commers_product'; $query->propertyCondition'status',1; $query->fieldCondition'field_description',NULL,$id',='; $result=$query->execute; 打印;打印结果; 在这里,我想从我的内容类型“护送”产品中获取特定$id=tid的字段描述,但它为所有tid提供了数组结构,而不是我在参数中提到的特定tid?

$query->fieldCondition'field\u description',NULL,$id,'=';应该像这样替换行,$query->fieldCondition'field\u_术语_reference_field',tid,$id',=';那么你就可以很容易地得到nid了。

这对我很有用

$termid = array(1); //Where you save term ID(s)
$nids = taxonomy_select_nodes($termid);
$products = array(); //Lets say nodes type is PRODUCT
if (!empty($nids)) {
    foreach ($nids as $nid => $value) {
        echo $products[$value] = node_load($value)->title; // Echo all the titles of related nodes of current term.
    }
}