The discussion revolves around the possibility of adding custom fields to Groups in Discourse, similar to how custom fields are used for Users. JQ331 asks if this is feasible, noting it’s not currently built-in but has been requested before. merefield confirms it can be achieved via a plugin, providing a code snippet to register a custom field type for Groups. AquaL1te expresses interest in using such a feature to add a location field for mapping purposes. JQ331 references a detailed guide by @angus on adding custom fields to models, suggesting it can be adapted for Groups, and shares a personal implementation example.
This would be awesome indeed. I would like to add a custom location field to groups so that I can use the g.json output to generate a map based on the groups and amount of members.
I’ll experiment a bit with your suggestion. Do you also have some more info about how to use this snippet? Can it be used in a custom theme component? How would someone do that? Has anyone already used it?
To add custom fields to models (topics, categories, groups), the following topic from @angus really lays it out as well as you’re likely to find:
He has put together some sample code specific to topics and categories - I believe the code translates generally well for adding custom fields to groups as well.
This post from me on that topic lays out how I’ve used the resource that Angus has put together: