You can set up OG to be completely transparent to users:

  • when a user creates content, the group reference field is hidden, and its value is set automatically
  • when the content is edited, the group reference field is still hidden

This can be accomplished with the Entityreference prepopulate module.

  1. Enable the Entityreference prepopulate module
  2. Edit the group membership field on your group content entity
  3. Under 'Additional behaviours' enable 'Entity reference prepopulate', then select:
    • 'Action: Hide Field'
    • 'Apply action on edit'

You then need to create links to create new content which contain the prepopulate data in the URL, in the form: node/add?og_group_ref=GROUP_NODE_ID

Comments

akolahi’s picture

Additionally, you can use Menu Tokens to create links with paths like node/add/group_content?og_group_ref=[node:nid]. When menu is placed on a group page, [node:nid] will produce the current group ID.