Questions tagged [group]

Use it for questions related to the Group module, not the Organic Groups module.

Filter by
Sorted by
Tagged with
10 votes
3 answers
22k views

Programmatically get the results of a view

Using the group module in D8, I have the below view with machine name: group_members_per_group Machine Name of: (Member account) User: Full Name is: field_user_full_name (Member account) User: ...
user avatar
6 votes
1 answer
3k views

What are the various roles supported by the Group module?

The Group module is an alternative for Organic Groups. For each group you can specify appropriate permissions, and this for various "roles" that are specific to the Group module (these roles are not ...
Pierre.Vriens's user avatar
6 votes
1 answer
2k views

How to add custom entities to group types?

I'd like to add my custom content entity to my group types, just like the module's "group node" plugin does already with nodes bundles. Has anyone done this? There does not seem to be much progress ...
theuni's user avatar
  • 845
5 votes
3 answers
2k views

How to programmatically add content to a group in the Group Module?

I'm using the Group module. If I have a group type such as Project, and I have a content type such as Article, and I programmatically created a new article node using Node::create(), how can I in the ...
Rawan Moukalled's user avatar
4 votes
2 answers
4k views

How can I programmatically add members to a group?

I am trying add members to a group programmatically using Groups module in Drupal 8, and I am doing the following to achieve this: use Drupal\Core\Entity\ContentEntityBase; $roles = array('test_role')...
ekta's user avatar
  • 211
3 votes
1 answer
4k views

How can I programatically load a group?

I have written this code to render a list of profiles (using the Profile module). It works fine. // render profiles $accounts = \Drupal\user\Entity\User::loadMultiple($uids); $storage = \Drupal::...
dbj44's user avatar
  • 4,734
3 votes
1 answer
468 views

How to implement the mass operations on the Group's members page using Views?

I use the Group module and I want to customize the page to manage the members of the group, created by the module. So I created a view by following the instructions below : How to add a column to ...
user avatar
3 votes
1 answer
2k views

How to display a views block on pages with a specific combination of URL patterns?

I'm using the Group module (1.0-alpha7) on a Drupal 8.1.5 and I want to display a view of recent article in my groups. I want to display the view on groups page (mywebsite/group/x where x is id of ...
Snabow's user avatar
  • 291
3 votes
1 answer
2k views

How to bulk assign existing content to a group created with the Group module?

The Group module is an alternative for Organic Groups. One of the features it offers is that you can assign nodes to a Group. Question: how to bulk-assign a set of existing nodes to a specific group, ...
Pierre.Vriens's user avatar
3 votes
1 answer
305 views

How to message or invite a group without joining it?

I'm using the Group module. I created a group(Job Post) with linked content types (Job details). Scenario: As a user, I created several jobs. I want to be able to invite/message another group (...
John Rey Tanquinco's user avatar
2 votes
1 answer
2k views

Is it possible to check with Twig the role the current user has?

Is it possible to check with Twig the Group role the current user has, to use it as in the following code? {% if is_member == true %} {# … #} {% endif %} I tried with $group_memberships = \Drupal::...
Mart Kolji's user avatar
2 votes
1 answer
1k views

Programmaticaly remove a member from a group

Using the Group module, what is the function to remove a user from a group using its user ID and the group ID?
Dave S.'s user avatar
  • 31
2 votes
1 answer
2k views

Programmatically add new role to group member

Trying to update a group membership to add an additional role, but cannot find any help on how to do this. I want to add the role of "manager" to all owners of "client" type groups, using the ...
jlscott's user avatar
  • 201
2 votes
1 answer
814 views

Get user ids of group members

I want to get a list of all users that are members of a group. I can get the members using getMembers(): $members = $group->getMembers(); foreach ($members as $member) { var_dump($member);...
stemiwe's user avatar
  • 71
2 votes
1 answer
641 views

How do I add a new group permission?

How to add new group permissions? describes how add new group permissions when using the Drupal 7 version of the module. function [mymodule]_group_permission() { return array( 'schedule ...
SomebodySysop's user avatar
2 votes
1 answer
462 views

Use node edit form layout for other entity types

The node edit form got a nice overhaul for Drupal 8's default admin theme, whereby a lot of the metadata fields like Revisions, Meta Tags, URL Aliases, Publish status, Promote status, etc are moved ...
JamesWilson's user avatar
  • 2,138
2 votes
2 answers
283 views

How to translate Groups in a multilingual site?

I have created a new grouptype and added some fields to have a "site". And then created a new group with this grouptype. I edited the overview site with some information. Now I would like to translate ...
Zeroplexer's user avatar
2 votes
1 answer
151 views

How are access permissions prioritized when multiple modules implement them?

I have the Group module setup where I only allow view permission for group content to group members, so I have closed groups. But additionally, I want groups to also make some content public to non-...
Dolf Andringa's user avatar
2 votes
2 answers
965 views

Programmatically remove content from a group

In order to add a node to any group in Drupal 8, I use the following code. $group->addContent($node, 'group_node:article'); Now, for removing content from a group, I have tried $group->...
user avatar
2 votes
1 answer
87 views

Searching fields in Group module

I cannot figure out how I can be able to search the fields(set as a new content type) in the Group module. For example, I created Groups(Group-Shop, Group-Salon, etc) under Group-Type-A with 3 fields ...
John Rey Tanquinco's user avatar
2 votes
1 answer
32 views

How to add a value to the object group in group module?

I have been using the Group module with D7 for a while, but I always regretted that there was no 'creation date' value for each group. I added a column in my database which fills in that value ...
Pierre_colin's user avatar
2 votes
1 answer
91 views

$group->addContent() in hook_node_insert() doesn't update the access permissions for the node

I have a content type with a field that lets the users decide which group to add the content to. The content is added to the group via hook_node_insert(). function tm_wiki_node_insert(NodeInterface $...
stemiwe's user avatar
  • 21
2 votes
2 answers
1k views

How do I get group to which the node belongs and redirect anonymous users to the login page if they land on it?

I'm using the Drupal Group module and I've added content to a Drupal group I've created. I've also added users to this Group. Works well: Drupal users have to login to see this content in that group. ...
therobyouknow's user avatar
2 votes
0 answers
861 views

Get the ID of the group to which the node is added

Using Drupal 8 with the Group module, I have an action that is run via hook_node_insert that needs to know the group id of the group that the node is added to. Im using this code to get the group id ...
stemiwe's user avatar
  • 71
2 votes
1 answer
2k views

Custom route using access check error with arguments

I have a custom route that needs to check if a user can create a certain group_node:article content inside a group (from the group module 8.x-1.0-rc2). The setting is as follows: mymod.routing.yml ...
theuni's user avatar
  • 845
2 votes
0 answers
138 views

How to show the actual node on a group-content page when using the Group module?

Creating a new group-content in Group module on Drupal 8 generates a normal node without any "live" context to the group. So viewing this node does not allow the group-actions block to work. If you ...
Martin Przybylek's user avatar
2 votes
2 answers
507 views

How to limit access of a view about Group Memberships to the Group's administrator?

I use the modules "Group" and "Views" to display to the administrators of the groups, the lists of their members. My problem : user1 is the administrator of group1. user2 is the administrator of ...
user avatar
1 vote
3 answers
5k views

How to get group ids by ids of elements of group content?

I use the Group module and I have created several groups and assigned several nodes as content of these groups. For example, I know id of some node. How can I figure out which groups contain this ...
Yakimkin Roman's user avatar
1 vote
1 answer
2k views

Hook into Group module

I'm creating a module for Drupal 8 that will auto fill some content in a add content page. Now I need to have a way to group different contents in one group. I found the Group module that does the job,...
JimmyD's user avatar
  • 410
1 vote
1 answer
105 views

How do I set a condition to only show a block to a group members?

Is there a way to check whether a user is a group member when the user visits the group page? I have some blocks that should be hidden if an user is not a member.
Tetragrammaton's user avatar
1 vote
2 answers
873 views

How to email all group members after a new node is added when using the Group module?

I have created one group using the Group module. In that group I have 1 node type and 3 members. I want to send a confirmation email to group members whenever I add new nodes of that node type. How ...
Sonvir Choudhary's user avatar
1 vote
2 answers
130 views

Display content by specific groups of users

Is it possible to display content by a group of authors without using a group module? I like the group module, but it's much more complex and robust than what I need it for. Synopsis: We need to ...
Christia's user avatar
  • 1,637
1 vote
1 answer
225 views

Is it possible to add an entity to the current route parameters?

Using \Drupal::routeMatch()->getParameter(), it's possible to fetch objects that come from the parameters of the URL. I'm wondering if it is possible to add values to the routeMatch. For example, ...
Jaypan's user avatar
  • 17.3k
1 vote
1 answer
107 views

How to create a message with message stack when user becomes a member of a group module group?

Hi currently I try to code a custom module for notification based on message stack module. Now I'm searching for the event or hook to perform some custom code when the user becomes a member of a group....
dercheffe's user avatar
  • 151
1 vote
1 answer
835 views

How to insert the title of the group in a message?

I created a custom module using the example in: https://www.drupal.org/project/message When a node is created, it is associated with a group: https://www.drupal.org/project/group Here is my module....
user avatar
1 vote
1 answer
464 views

Select groups to relate the node to directly in the node creation form

An admin who wants to relate a node to a group can go to the group and then create a node from there (/group/{id}/node/create) . The node is then assigned to the group. Or she can assign a already ...
Angus's user avatar
  • 258
1 vote
1 answer
690 views

Show a different view mode depending on role

Using the Group module, when a user views a group, I want to use a different view mode depending on whether the user is a member of the group or not. Conceptually, this is almost identical to showing ...
Jonathan's user avatar
  • 1,118
1 vote
1 answer
479 views

How do I add a user to a group?

I am using the Drupal 7 version of the Group module. I found this Drupal 8 code which adds a user to a group, and I can't find anything similar for Drupal 7. use Drupal\Core\Entity\ContentEntityBase; ...
Imogen Johnson's user avatar
1 vote
1 answer
45 views

How to display articles based on group combinations of various group types?

I looked at the group module. Defining permissions based on user and entity memberships would suit my needs very well, but sometimes I would need a combination of various group memberships to define ...
NedRise's user avatar
  • 13
1 vote
1 answer
486 views

How to restrict group node access to a user/member of an group?

I am using the Group module and I have created a group called "Group-Y" and group type "Group-type-Y". I also defined a group role name "Admin". Added an member with role "Admin". I have checked this ...
Prasanth R's user avatar
1 vote
1 answer
70 views

How to assign define role to group creator in groups created with the Group module?

I am using the Group module. Whenever a new group is created, member is added to that group with role none. I want to assign a role to a group when a user creates a group. How can I do that?
Suresh Kumara's user avatar
1 vote
1 answer
260 views

How to send an eMail to registered users after they are invited using the Group module?

I use the Group module and the "Ginvite" submodule on Drupal 7.52. The module allows you to invite people (either registered users or users without an account) to become a member of the group that ...
user avatar
1 vote
2 answers
610 views

How do I change the site name in the .theme file?

I'm looking for a solution to change the site name in a .theme file in Drupal 8. I'm using the Group module and want to display a different site name when the current user navigate inside each group. ...
Snabow's user avatar
  • 291
1 vote
0 answers
47 views

List all groups of a user in one row as a multi-field

I want to list all the users and groups they are member of in one table, one row per user. I have a simple view that lists all users in the system. I added relation to group content membership and a &...
carlo's user avatar
  • 21
1 vote
0 answers
315 views

Prevent access from files with direct url

In the Group module people can upload files if they're group manager. But the thing is, these files should be restricted to the group and everyone who isn't a member may not see this files. The ...
Tetragrammaton's user avatar
1 vote
0 answers
284 views

How to ensure that node access check results are enforced everywhere? [closed]

I am trying to do this without hook_node_grants because, for some reason, it messes with the nodes that are being controlled by the 'Group' module. The Group module itself used to use Node grants, but ...
Jed_BH's user avatar
  • 421
1 vote
1 answer
49 views

Sub groups under groups

Anybody has idea about how we can have Sub Groups under Drupal Group? This module; https://www.drupal.org/project/group, will manage grouping of content, users.... perfectly. But we are looking to ...
Bitmapio's user avatar
1 vote
1 answer
96 views

Using group and rules modules to automatically create group for new user

I am using the Group (not OG ...) and rules modules for this task. I created group type, Applications Support. Then I created a rule, After saving a new user. Under the rule, I used the following ...
Panda's user avatar
  • 53
1 vote
2 answers
703 views

Where in the MySQL database schema is the URL alias for a group relation?

I am building a report outside of Drupal that pulls data from a Drupal 8 database. The report shows titles of different nodes and I want to link those titles to the web page for that content. This ...
Eric Barr's user avatar
  • 111
1 vote
1 answer
49 views

How to create entity relation of counselor to client?

I'm trying to create a relation in D8 between a counselor and clients. The counselor would have to record counseling hours for each client. I've looked at the group module, even building the ...
marklame1's user avatar