发布于 2016-10-21 16:18:00
看一看这个非常基本的规则(以规则导出格式):
{ "rules_check_taxonomy_term" : {
"LABEL" : "Check Taxonomy Term",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "node_insert" : [], "node_update" : [] },
"IF" : [
{ "entity_has_field" : { "entity" : [ "node" ], "field" : "field_tags" } },
{ "list_contains" : { "list" : [ "node:field-tags" ], "item" : "21" } }
],
"DO" : [
{ "drupal_message" : { "message" : "A node containing the tag [node:field_tags] just got created or updated." } }
]
}
}这条规则的作用如下:
field_tags“字段,它是我要检查的术语引用字段的机器名称。21“(这是我希望在此规则条件下签入的术语id )。[node:field_tags],实际术语id = 21)。在这个问题的背景下,在上述规则示例中,最关键的是两个规则条件。
使用规则UI在站点中导入上述规则。以下是您需要进行的调整,以使其适合您的情况:
https://drupal.stackexchange.com/questions/77976
复制相似问题