Community Documentation

Hiding the OG field from users entirely

Last updated January 22, 2013. Created by joachim on January 22, 2013.
Log in to edit this page.

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

Additionally, you can use

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.

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 7.x
Audience
Site builders
Level
Intermediate
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here