This project is not covered by Drupal’s security advisory policy.
Group Assignment Widget lets editors assign an entity to a Group directly from a field on the entity's own edit form. It automatically creates the Group relationship on save and locks the field afterward, so no separate "Add content to group" step is needed.
If you use the Group module and want a simpler, field-based way to place nodes (or any content entity) into a group, this module handles the relationship for you and keeps the assignment stable once set.
Features
The module adds two entity reference field widgets:
- Group Assignment (with auto-relationship): an autocomplete widget for choosing a group.
- Group Assignment Select (with auto-relationship): a select-list widget for the same purpose.
Both widgets do the same underlying work: when the entity is saved, a Group relationship is created between that entity and the selected group. Changing the value on a later edit removes the old relationship and creates the new one. The field is locked after the first save, so the assignment can't be changed accidentally; only users with the dedicated permission can edit it later.
Typical use cases: assigning articles to a department, placing pages under a team or organization, or letting content authors pick a group without training them on the Group module's separate content-adding workflow.
Post-Installation
There is no central configuration page. After enabling the module:
- Add an Entity reference field (referencing Group) to the bundle you want to assign, if you don't already have one.
- Go to Manage form display for that bundle and set the field's widget to Group Assignment (with auto-relationship) or Group Assignment Select (with auto-relationship).
- At People > Permissions, grant Edit group assignment field after creation to any role that should be allowed to change the assignment after the entity is first saved.
Note: the relationship is only created if the selected group's group type has an installed relation plugin that supports the entity type and bundle being saved. Make sure the relevant content plugin is enabled on the group type.
Additional Requirements
- Group module
- Options module (Drupal core)
- Drupal core 10.3+ or 11
Similar projects
The Group module itself provides the standard way to add content to a group through the group's own interface. This module differs by moving that action onto the content entity's edit form.
Project information
- Project categories: Content editing experience
- Ecosystem: Groups
- Created by andileco on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
