Thanks, @tshenry. Not sure why the group owner code didn’t work for me–probably something to do with how I set up the plugin.
I have found the AJAX approach to work as an “MVP” method. BTW, I believe you can make an API call to
[forum-url]/groups.json to get back all site groups, and then you can loop through from there, so no need to make multiple calls.
I was hoping to ask:
–For the AJAX/JSON API approach, do you know how to make it so that a function only runs when a user goes to a specific page? Right now, If I put the AJAX code in the </ head> section of my customize dashboard, I can get it to work, but it runs every time the site is loaded (when I only want it to run when the group index page is loaded)
–In my case, I’m using AJAX right now especially because I not only need to show group owners, but also a few other new traits of a group that I am adding. These would be like custom fields of the group that I am trying to retrieve and show. Right now, the “MVP” version (while I’m still learning how the discourse codebase works) is to save them to a separate non-discourse database that I pull from and add to the group index page.
Obviously, the cleaner solution would be to add the custom traits to the groups in the discourse database and call those back. Just trying to gauge the type of operation that would be required here. Would that require redoing a bunch of the discourse files (controllers, models, templates)?