Hiding the OG field from users entirely

Last updated on
18 May 2024

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

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

Help improve this page

Page status: No known problems

You can: