Advertising sustains the DA. Ads are hidden for members. Join today

Group 8.x-1.x

Placeholder page for the Group (version 8) documentation, about anything that does not apply to the 7.x version of the Group module.

Note: refer to Additional resources for a link to a video that demonstrates how to use the Group module.

Custom entities as group content

To allow your custom entity to be added to a group, you must expose it as a GroupContentEnabler plugin.

e.g.

<?php

namespace Drupal\my_module\Plugin\GroupContentEnabler;

use Drupal\group\Plugin\GroupContentEnablerBase;

/**
 * Allows MyEntity content to be added to groups.
 *
 * @GroupContentEnabler(
 *   id = "my_plugin",
 *   label = @Translation("My plugin"),
 *   description = @Translation("Adds my_entity to groups in order to blah blah."),
 *   entity_type_id = "my_entity",
 *   path_key = "my_entity",
 * )
 */
class MyPlugin extends GroupContentEnablerBase {
}

After this you will be need to install the plugin. This is done as follows:

  1. Navigate to Admin -> Groups -> Group Types
  2. For the group you want to add the content to, expand the operations selector, and choose 'Set available content'
  3. Click the 'install' button next to the entity type you created the plugin for

For more information, see the gnode.module

New in Group 8.x-1.x

The 8.x release of the Group module uses the features available as of Drupal 8.

Guide maintainers

kristiaanvandeneynde's picture