As the title suggests, I am trying to use the rules module to add a Role on joining a specific organic group.
There doesnt seem to be any module for drupal 6.xx (unlike drupal 5.xx). Rules seems like it should be a good fit for this.
This is my first time using this module. I ran through some examples, etc. to get familiar with it.
I Choose >> Triggered Rules
-Add new rule.
Event = User Joins Group
-Add Action
Add Role (then choose the role I want added).
No problem.
The problem is, I want Organic Group A to add a specific role. Organic Group B to add a different role. I can see how to add specific roles, but not how to filter by which Organic Group they join. I am guessing it is under conditions? Ie "User Joins: Organic Group A = True".
-Add Condition
-User:
User that suscribed to the group
-Group:
Group???
(It doesnt have any options other than the word group. I was thinking the names of the organic groups should be here).
Thank you for any suggestions.
Comments
I'm not a super active user
I'm not a super active user of rules, so there might be another way of doing this, but it looks like you might have to write a custom condition which allows you to select a certain group to match against.
Kyle Mathews
Kyle Mathews
auto join to og groups when upgrading member prOfile
hI,
i do not have the anwser.
But I have a similiar question.
A multi-role site.
User ""user1 moves from role A to role B and a group is automatically created for them titled "user1" group.
Is this scenario possible?
Any hints.
Thanks.
need to a write custom action
You'd have to write a custom action that would create a group node and title it after the user. Search around for instructions about how to create a node. I don't think there's any already-written code to do it but if you're familiar with Drupal/PHP, it wouldn't take you long.
Kyle Mathews
Kyle Mathews
User joins GROUP_A -> Assign user role ROLE_A
Rule Set: "Subscribed; add Role"
-- Arguments: Content (node), User (user)
-- Rule: "Subscribed to Group A"
-- -- Condition: Numeric Comparison, "[node:nid]" is Equal to "GROUP_A_NID"
-- -- Action: Add user role, select "ROLE_A"
-- Rule: "Subscribed to Group B"
-- -- Condition: Numeric Comparison, "[node:nid]" is Equal to "GROUP_B_NID"
-- -- Action: Add user role, select "ROLE_B"
Triggered Rule: User Subscribes to Group
-- Triggers on: User Subscribes to Group
-- Action: Run Rule Set "Subscribed; add Role"
-- -- Arguments: Content = "Group", User = "User that subscribed to the group"
Notes:
- Replace GROUP_X_NID with the node id of relevant group.
- Replace ROLE_X to the relevant role to be assigned.
I initially thought of using PHP to assign a role, but decided that's too risky. The above works, and isn't too difficult to manage. Find the group's NID by editing and seeing URL (that's one way).
Remember not to use this to assign a role with powerful permissions. Rules and/or Groups functionality may break for some reason, and you don't want people taking over your site!
reverse process so users with RoleA get added to GroupA
thanks for this clear presciption - would it work in reverse (obviously changing the rules) ie that when someone is given a particular Role they are automatically joined to a particular OG - seems like an obvious itch to me (all webeditors get their own OG to discuss issues, run their book/manual etc) but couldn't spot a module that does it so maybe Rules is the way to go. any comments?
pete davis : fuzion : connect + campaign + communicate
Probably Obvious: node id of relevant group
I would really like to use the rules module in the manner suggested by aeronox. I just can't seem to complete aeronox's instruction set.
Here's the problem. I don't understand how to locate the information I need to complete "[node:nid]" is Equal to "GROUP_A_NID."
I can find the node:nid for the front page of the OG that I'd like to want to receive my rules declaration. I just can't find the "group_x_nid" for the same page.
If the node:nid refers to the root page of an organic group, and the "GROUP_A_NID" refers to the same page, how does one locate and write out this group numeric equivalent to the node:nid?
Thanks for your help.
I am trying to get this to
I am trying to get this to work as well, however i got stuck at the "GROUP_A_NID" as well.
Don't know what to fill in here.
Extra explanation would be great.
Thanks
Has anyone gotten this to
Has anyone gotten this to work?
By the way, to get the Group NID, just click on edit for the group and it'll display the NID in the url.
rules to create og groups
Hi,
Hope someone can give me some pointers.
Is it possible to get rules to automatically create organics groups based on user profile?
cheers