0

I'm using the Organic groups (=OG) module. When a user subscribes to an OG they just see "Unsubscribe from group", even if they are not yet members, but their membership is pending. What is the best way to display a message such as "Thanks for your subscription request, it is currently being considered." or something like that?

Note: I have quite a number of questions related to Organic Groups but this is the best place I have found or support. If you can suggest other sources of OG support I would be very grateful!

0

A possible solution for this is to use a combination of the Flag and Rules modules, which integrate very well with the Organic groups module.

Here are the highlights of how you could make it work:

  1. Create a 'global' flag (using Flag) that will be used to identify (flag) users with their membership is pending
  2. Create a 1st rule (using Rules) like so:
    • Rules Event = User has become a group member
    • Rules Condition = og-membership:state EQUAL TO pending
    • Rules Action = set the flag (defined as in "1.") the user (using Flag)
  3. Create a 2nd rule (using Rules) like so:
    • Rules Event = User has become a group member
    • Rules Condition = og-membership:state EQUAL TO active
    • Rules Action = unset the flag (defined as in "1.") the user (using Flag)
  4. Create a 3rd rule (using Rules) like so:
    • Rules Event = Content is viewed
    • Rules Condition = "Path matches some path on which you want to show such message"
    • Rules Action = Show a message on the site

In case you have multiple organic groups for which you want to implement something similar, you have these options:

  • Create a similar flag and a similar set of 3 rules for each of these groups.
  • Use the Rules Conditional module so that you can combine the above logic for all groups in an enhanced version of rule2, -3 and -4.
  • It would probably also be a good idea to move part of the logic in the above rules in a 'rules component'.

Using the Rules Conditional module you could also combine rule 2 and rule 3 above in a single rule.

In case the above may seem like overkill (2 extra modules, and 3 rules to be created ...), keep in mind that with these very same 2 modules you can implement lots (dozens?) of other functions/features. Probably also to address "... quite a number of questions related to Organic Groups..." you mentioned in your question.

Video tutorials

If you're not familiar with Rules, checkout the video tutorials Learn the Rules framework. And/or the similar set of 8 video tutorials about the Flag module. For Organic Groups there is another set of amazing videos to Learn Organic Groups.

Possible alternative

For anybody who considers the Organic Groups module as rather complex (like me ...), have a look at the Group module as a possible alternative. For (way) more details about this module, refer to my answer to "How to create basic Organic Groups functionality with flags and references?".

| improve this answer | |
  • Thank you very much for your detailed answer. It does seem very complicated for something that I would have thought would be a very common requirement! I am reasonably familiar with both Rules and Flag, I'll try this out. OG is interesting but does seem extremely complex for the functionality it adds - although perhaps I'm missing something. – James Nov 3 '15 at 16:35
  • That looks interesting, although it makes me nervous that there is only one developer... – James Nov 3 '15 at 17:07
  • I'm no longer using organic groups as it proved to be too complex for what I required. – James Feb 11 '16 at 16:02
  • Thanks for the feedback James. You're not the only one who things OG is (way too) complex. That's probably why more and more people start to consider/use the "group" module as an alternative for it ... So just in case you ever have an OG-like requirement again, keep that module in mind "too" ... – Pierre.Vriens Feb 11 '16 at 16:20

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.