- 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.
- Enable eca_base, eca_content, eca_user, eca_vbo (separate download), group_action, views_bulk_operations
- 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)
- Create a new ECA model
- Add an Event, use the template "VBO: Execute Views bulk operation (one by one)" and name it "Add to Group (Careers)"
- Add an Action, use the template "Group: Add Content (node only)"
- choose "Type of Group Content" = Content (dynamic)
- Set "Group ID / UUID" = 1 (or your group ID)
- Set "Entity" = [event:entity]
- Add an Event, use the template "VBO: Custom access for Views bulk operation"
- Set "Operation Name" to EXACTLY the same string as above, e.g. "Add to Group (Careers)"
- Add an Action, Use template "Current User: Load" with token name "user"
- Add an Action, Use template "Entity: Load"
- Set "Name of Token" = grouprel
- Set "Load entity from" = Type and properties
- Set "Entity type" = Group Relationship
- Set "Property Values"
type: "team-group_membership" gid: 1 uid: "[user:uid]"
Where 1 is the ID of the group you're using.
- Add a Condition, Use template "Token: Exists" and set "Name of token" = grouprel (or whatever you named your token in previous step)
- Add an Action, Use template "VBO: Set custom access on Views Bulk Operation" and leave "Access granted" as yes
- Save your ECA Model
- Edit your view, within the "Global: ECA bulk operations" field, make sure your new option is selected.
- Save the view
- 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