2

How to use rules to compare a field from the node with a specific Organic Group?

I am using rules event after saving new content of type X. Now I need to specify if in the field field_group the value is a specific group.

I am able to get the field of the node, but have no clue how to be able to compare it with a group I want.

  • "compare a field from the node with a specific group" specific group name? or group users? – No Sssweat Sep 13 '15 at 3:04
  • the group it self, if the compare only works with the name thats good to. Not with any users in group. – Tom Van Minsel Sep 13 '15 at 9:36
1

Ok, lets assume that your group name is called "Pokemon"

1) Under Conditions, click on Add Condition.

2) In the drop down, select TEXT COMPARISON

3) Click on the Blue Link that says (DATA SELECTORS)

4) Look for your field, if you named it "group", then look for node:field-group

then highlight it, copy and paste it under Data Selector*

7) Under Matching Text put Pokemon

8) click SAVE

Note: obviously, replace Pokemon with your actual group name.

  • Hey, thx for the reply (i wanted to give you a vote but still not allowed) you answer works only thing step 4) should be node:field-group:title just for those that needed it to still if anyone knows another way i would like to know it (even if it is in script or patch) cause this is a nice temp solution but not perfect. – Tom Van Minsel Sep 14 '15 at 0:49
  • Hey, thx for the reply (i wanted to give you a vote but still not allowed) you answer works only thing step 4) should be node:field-group:title just for those that needed it to still if anyone knows another way i would like to know it (even if it is in script or patch) cause this is a nice temp solution but not perfect. if anyone changes the name or you have multi lang this could be a mess + if you do this with NID the problem is worse since the comparison operation only has - contiains - starts with - end with - regX and not is equal start/end with wont do (this should be up) – Tom Van Minsel Sep 14 '15 at 0:56
  • @TomVanMinsel if you want equals to, you could use DATA COMPARISON instead of text comparison. for DATA VALUE you can click on switch to direct input mode and then put your number on the field. – No Sssweat Sep 14 '15 at 1:27
  • but then its not allowed to put a custom value and i cant select a group either – Tom Van Minsel Sep 14 '15 at 12:28
  • @TomVanMinsel for custom value, you need to click on the switch to direct input mode button. (it's a small grey button). – No Sssweat Sep 14 '15 at 23:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.