Adam
Adam

Reputation: 9049

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 help me with the check a truth value feature?

Upvotes: 1

Views: 1891

Answers (2)

Lowell Montgomery
Lowell Montgomery

Reputation: 567

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.

Upvotes: 1

Laxman13
Laxman13

Reputation: 5211

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.

Upvotes: 2

Related Questions