开发者

attempting to use Drupal's Rules module and check a truth value

if([node:term] == "Main Stage Theatre"){return TRUE;}

First I have a condition that checks the node creation of an Event.

Now, this second condition i want to check the taxonomy terms, and if it is the right one it will add to the my node queue.

my above piece of code I don't think is correct. Can someone h开发者_运维技巧elp me with the check a truth value feature?


Your code looks correct, did you include PHP tags? You have to wrap your code in <?php ?> tags in the Truth value textfield.

I have this working with:

<?php if ('[node:term]' == 'Comedy') { return TRUE; } else { return FALSE; } ?>

Note: If you are allowing multiple terms to be selected for an Event node, [node:term] only returns the "top" term.


For that kind of comparison I suggest using "text comparison"; it compares two text fields and evaluates TRUE if the two fields match. You could use a "token" (e.g. [node:term] in your example) in one field and text (e.g. Main Stage Theatre) in the other field. You can also check a box to return true if the two fields do not evaluate as equal and there is another checkbox option to use Regex for the match comparison. I just used it to check the language of the content a comment was left on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜