Created on 18 March 2023, over 1 year ago
Updated 9 July 2024, 4 months ago

Problem/Motivation

I am really struggling to get to grips with using the Group module in the the way that I am used to site-building with Drupal.

The route /group{id}/nodes just doesn't cut it in terms of flexibility and need to have more control.

I thought that on the face of it, Group actions and VBO together might provide me with a simple way be able to browse a list of eligible nodes and simple assign one or more of them to a Group but I can't see how to do it.

I can create a new action using the token [group-id] ...

But I don't know if that's even right and I don't know how or where to use it because, for example, when I add a VBO field to a view of nodes, that new action does not show up as a candidate?

Could someone please help me to understand exactly how to use this module to make it quick, easy, and above flexible for me to assign ('add') nodes to Group or have I got the wrong end of the stick entirely?

If nothing else then just one or two examples of he module's use as part of the module documentation would be really very useful

Thanks all

πŸ’¬ Support request
Status

Active

Version

1.1

Component

Miscellaneous

Created by

πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @SirClickALot
  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

    Can anyone please offer a bit of insight as to how to use this module's features?

  • πŸ‡ΊπŸ‡ΈUnited States liberatr Portland, OR

    Here is an ECA model that shows one way to use this module, using the ECA_VBO module.

    Advantage of this is that the Action should only appear if the user is a member of that group, and you can place it on the default Admin Content screen, if you are willing to recreate all of your other actions as ECA models. But really once you drink the ECA Kool-Aid you should learn how to do these, because you'll be using it all over the place.

    1. Enable eca_base, eca_content, eca_user, eca_vbo (separate download), group_action, views_bulk_operations
    2. Add the "Global: ECA bulk operations" field to your view. (this was very hard to figure out, as it seems like this should work with normal VBO actions, but it only works with the special ECA checkbox)
    3. Create a new ECA model
    4. Add an Event, use the template "VBO: Execute Views bulk operation (one by one)" and name it "Add to Group (Careers)"
    5. Add an Action, use the template "Group: Add Content (node only)"
      1. choose "Type of Group Content" = Content (dynamic)
      2. Set "Group ID / UUID" = 1 (or your group ID)
      3. Set "Entity" = [event:entity]
    6. Add an Event, use the template "VBO: Custom access for Views bulk operation"
      1. Set "Operation Name" to EXACTLY the same string as above, e.g. "Add to Group (Careers)"
    7. Add an Action, Use template "Current User: Load" with token name "user"
    8. Add an Action, Use template "Entity: Load"
      1. Set "Name of Token" = grouprel
      2. Set "Load entity from" = Type and properties
      3. Set "Entity type" = Group Relationship
      4. Set "Property Values"
        type: "team-group_membership"
        gid: 1
        uid: "[user:uid]"

        Where 1 is the ID of the group you're using.

    9. Add a Condition, Use template "Token: Exists" and set "Name of token" = grouprel (or whatever you named your token in previous step)
    10. Add an Action, Use template "VBO: Set custom access on Views Bulk Operation" and leave "Access granted" as yes
    11. Save your ECA Model
    12. Edit your view, within the "Global: ECA bulk operations" field, make sure your new option is selected.
    13. Save the view
    14. For each group, you will need to recreate this Model
  • πŸ‡ΊπŸ‡ΈUnited States ultimike Florida, USA

    @liberatr - thanks for posting this.

    I checked this out during DrupalEasy Office Hours with some of our alums and found the idea interesting.

    I was interested in checking it out as something I might be able to use on the soon-to-be-updated DrupalEasy Academy web site. I use the Group module for our "terms" ("Spring 2024 DCO", etc...) and having a nicer interface to add content (lessons, screencasts, etc...) to each term is something I'm definitely interested in.

    But, as you probably already know, your model is limited in that the group name/id cannot be passed into it - it must be hard-coded as part of the model. Which means, if I have 120 terms, then I need 120 models - this is less-than-ideal.

    We couldn't brainstorm a way to get around this limitation using only ECA and the other modules you use above. In fact, I think it would probably be easier to just create a custom VBO "Add to group" action where a form is presented to the user to select the group to add the content to.

    Anywho, thanks for sharing this - always great to see cool stuff that ECA can do.

    thanks,
    -mike

Production build 0.71.5 2024