This project is not covered by Drupal’s security advisory policy.

This module is an API module that allows you to find Group in different scenarios.

Predefined finders:

  • Create new group: Group from create group route (dummy group).
  • Group by content: Group from grouped content. It returns the first group. However, you can override it in case you would like to to return a group other than the first.
  • Group route: Group from a group route.
  • Group URL query: Group from the URL query (?group=x)

Features:

  • Find group in different contexts other than the group route.
  • Alter/Override predefined finders according to your needs. For example you could change the weight (the higher the number, the later the founder is being called) for the predefined finders.
  • Create your own finders.
  • Provides a plugin context for group finder.

How to use in your custom code:

/** @var \Drupal\group_finder\GroupFinderInterface $group_finder */
$group_finder = \Drupal::service('group_finder.provider')->get();
$group = $group_finder?->getGroup();

Used by:
This module is used by Group Media Library module.

Project information

Releases