1

Use Case: We want to automatically add nodes to groups based on existing taxonomy terms. So when we create a new group it is populated with existing site content such as case studies and white papers that may be relevant.

I was hoping the rules module would allow this but it is not immediately obvious as I was thinking you could set up a series of rules to run that have a logic of if node has taxonomy term x then place in Organic Group Y. This would be nice as removes error and also means editors do not have to add taxonomy terms and then also decide which groups to post into.

1 Answer 1

0

Custom module will help. I would use node_insert() and node_update() although we have used submit handlers for this in the past also.

Code to add a node to a group is:

$form['group_audience'][LANGUAGE_NONE]['#default_value'] = $group_audience; 

I have read that og_group() can set a node type entity as group content, but the api looked like it changed to us.

The taxonomy_access module might provide another way of thinking of this that suits your needs.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.