Recently came across a scenario where I wanted to use some values from the parent group of a node in a panel and was unable to load the parent group as a context. The solution seems to be implementing a plugin for ctools. I'm not sure which plugin yet but I am going to look into this over the next few days and see if I can find the solution.

This is the area I'm talking about. Specifically creating a "Group from Node" relationship like there is a "User from Node" relationship.
Panels relationship example

CommentFileSizeAuthor
group-panels-relationship.png64.82 KBctrlADel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ctrlADel created an issue. See original summary.

kristiaanvandeneynde’s picture

Heh, that's weird I thought I had already added that but it's indeed missing.

It should be easy to create, though: Check if the context entities are group enabled, if so: generate a relationship for it: "Parent group of Node", "Parent group of Group", etc.

I may have written my own in a previous client project and not remembered to add it into group :(

DerTobi75’s picture

Hi there,

any chance, such a feature makes it into one of the next releases?

I need to show a mini panel withe the group name a node belongs to.

Best regards,

Tobi

kristiaanvandeneynde’s picture

Hi Tobi!

I can certainly appreciate the need for this functionality, so I've added it to #2694173: [meta] 7.x-1.0 release roadmap.

This should be 30 minutes work tops, but I currently can't invest that amount of time while there are more critical D7 and D8 issues. Adding it to the roadmap will prevent it from being forgotten and perhaps give it the visibility it needs for someone else to pick it up.

maxplus’s picture

Yes,
having a real group context inside panels would be great.

Now we only have the "Parent Group" from the node that only makes the group title available to panels, not the gid.
Having the gid would be much better (and all the other group variables)

Oscartt’s picture

+1 for this feature, desperately needing it for my project. Will try to make it myself, but not sure if I can make it work..

EDIT: Creating a proper CTools relationship plugin for this was a little out of my leaque, but I was able to come up with an alternative solution. So let's assume we are creating a node template in Panels, and we want to pull in the parent group of the node being viewed, in order to show group join/leave buttons and other group data. This is how I got it to work:

1. Create the node template in Panels that you wish to do this in. In my case, I created a variant with selection rules: Node being viewed is type "Group Topic"

2. Go to the Contexts settings. In Relationships, select: "Entity property or field (via Entity Metadata Wrapper)"

Settings for that:

Entity: Node being viewed
Identifier: Just the title, can be anything. I set it to 'Parent Group from Node.'
Keyword: group
Data selector: group
Concatenator: Left it at 'And'

That's it! Now you can pull in all the group related data to your node template :) Btw, thank you kristiaan for this awesome module!

Soul88’s picture

Status: Active » Closed (outdated)

We thank everyone for their collaboration on this issue, but as the D7 version is no longer supported, we will now close all D7 issues to keep the issue queue a bit tidier. This information won't go anywhere, it just won't show up on the list of open issues anymore.

Please see: https://www.drupal.org/project/group/issues/3163655 and https://www.drupal.org/project/group/issues/3203863#comment-14100281 for more details.