- Issue created by @aasarava
- πͺπΈSpain rteijeiro
Same question here. I'm actually trying to change the name of the relationship which defaults to "content" and I'm not sure there is straightforward way to do it. Any hints?
- πΊπΈUnited States aasarava San Diego
This is as far as I got, which uses the human-readable content type labels instead of what the group module generates. Place this in a custom module and replace "my_module_" with your module name.
I still don't know how to change the actual descriptions. If anyone can provide some guidance on further customizing this, that'd be greatly appreciated.
/** * Implements hook_PLUGIN_ID_alter(). */ function my_module_group_relation_type_alter($definitions) { foreach ($definitions as &$definition) { // On the group/{id}/media/create and group/{id}/node/create pages, // that are generated by the Group module, // and on entity creation forms within groups, // use the plain human-readable bundle label (e.g., "Article", "Event"). if ($definition->id() === 'group_node' || $definition->id() == 'group_media') { $entity_type = $definition->get('entity_type_id'); $bundle = $definition->get('entity_bundle'); $bundle_label = \Drupal::entityTypeManager()->getStorage($entity_type . '_type')->load($bundle)->label(); $definition->set('label', new TranslatableMarkup('@bundle', ['@bundle' => $bundle_label])); } } }