A few questions relating to groups

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
capalex65
Registered User
Posts: 18
Joined: Sun Aug 16, 2015 3:08 am

A few questions relating to groups

Post by capalex65 » Tue Mar 12, 2019 5:33 pm

Howdy!

So, I've got a few questions relating to groups, and more specifically, how to interact with them through an extension.

What I want to do is this: Add a column to the groups table, add a dropdown in the edit groups page (found the event for this already), and saving the data upon submit to the groups table like normal.

Therefore, my questions are as follows:

1) Can I add a column to the groups table with an extension migration file? (And how do I target this properly for adding and removal upon data deletion?)
2) Which event do I hook into to add the data to my dropdown in the editing page? (The data would come from another table in the db, created by my extension.)
3) Which event do I hook into to modify the saving of a group so it grabs the data from my dropdown?

Hope you guys can assist here, as I've been banging my head against the wall on this for the past few days.

User avatar
kinerity
Community Team Member
Community Team Member
Posts: 2081
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Re: A few questions relating to groups

Post by kinerity » Tue Mar 12, 2019 9:20 pm

capalex65 wrote:
Tue Mar 12, 2019 5:33 pm
1) Can I add a column to the groups table with an extension migration file? (And how do I target this properly for adding and removal upon data deletion?)
https://github.com/kinerity/postcountre ... hp#L18-L26 and https://github.com/kinerity/postcountre ... hp#L33-L41
capalex65 wrote:
Tue Mar 12, 2019 5:33 pm
2) Which event do I hook into to add the data to my dropdown in the editing page? (The data would come from another table in the db, created by my extension.)
The PHP event would be something along these lines: https://github.com/kinerity/postcountre ... #L107-L128
capalex65 wrote:
Tue Mar 12, 2019 5:33 pm
3) Which event do I hook into to modify the saving of a group so it grabs the data from my dropdown?
See above.
Kailey Truscott - Community Team

capalex65
Registered User
Posts: 18
Joined: Sun Aug 16, 2015 3:08 am

Re: A few questions relating to groups

Post by capalex65 » Wed Mar 13, 2019 10:11 am

You're a hero, that's exactly what I needed. Thanks! :D

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests