0

I am using OG, Flag and Rules module. I would like to do like this.

When a user click Flag links in Group (name is follow_group) then all group content of that group will be flagged as following.

For now, i'm stuck at getting all group content of specific group. Is there a way to get group content of current group?

0

All the contents are associated in og_membership table. If you can get the gid (group node id), then it will be easier to get the content associated with that group.

$og_contents = db_select('og_membership', 'ogm')
->fields('ogm', array('etid'))
->condition('ogm.gid', $gid, '=')
->condition('ogm.entity_type', 'node', '=')
->execute()
->fetchAll();
| improve this answer | |

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.