Is this a use case for user custom fields?

I’ve been trying to figure out how to allow users to create subforums, that would work like slack channels.

One of the suggestions was to use tags. So a user would create a tag (or an app I build would do it through the api), and that tag’s page would function like the subforum’s page.

The question then is how to make it so that only members of the subforum could post to that subforum. In other words, only members of that subforum could have the subforum’s tag linked to their posts.

Is there a way to use “user custom fields” to achieve this? In some way to mark a user as being permitted to post with a certain tag?

I don’t quite follow what user custom fields are meant for, so I’m hoping to understand more.

1 Like

I believe tags don’t come with any user-level permissions. You might want to check categories instead.

1 Like

Discourse uses groups and categories to control access to content. Have a look at the video in this topic for details: How to use category security settings to create private categories

Thanks for the replies, guys. I agree that categories seems like the easier way to do this. But, these would be subforums that users could create a lot. There could be hundreds or more (the subforums are a key piece of the app, so will grow as user base grows).

I’ve been told that creating hundreds/thousands of categories will be a big problem, so that I should look for other solutions. Do you have other suggestions? I am willing to build a separate app that interacts with the API. The key thing I want from Discourse is the outstanding post/reply/tag functionality.

What you want to create is not something Discourse is aimed for.

You want a Reddit/Discord platform, where people can come and create subreddits/servers they “own” while your retain all control and monetization of the platform.

Discourse aims to be the complete opposite, allowing each subreddit/server/guild to be their own site, own their data and live in their own URL.

While you can hack an open source project a lot, I would recommend using something else that is closer to what you want.

3 Likes

I appreciate that this is not the normal use case, but I would definitely like to find a way to do this with Discourse, given how awesome discourse is. And I can get decently close–I create a tag with the API, and send users to the tag page that acts like the subforum page. The key piece i am missing is the ability to limit users who can post with that tag.

Discord would not work for these purposes, because of limits they have with integrating with apps. I’m not familiar with how I could integrate reddit with an app.

Are you suggesting that I could actually make this work with Reddit, or did you just mean that is the “type” of functionality I have in mind?

Either way, the key benefit of discourse as I see it is that it is a forum, not a chat. And the forum-like functionality is what I want here. I haven’t seen alternatives to discourse that could work in that regard, but I’m definitely open to suggestions.

That key piece is not something on the roadmap, and not something we plan to add.

There were many topics on this over the years:

1 Like

I’ve seen those. One difference here is that I am happy to build out an entirely separate app that then interacts with the discourse API to give the user the experience of creating a subgroup. So I can create the subgroup myself in the separate app, associate members with it, etc.

But I would like to still be able to use the discourse front end posting functionality (creating topics, replying, linking to categories, and adding tags mainly) on that subforum page that my app has created.

I was told that there is a way to link user custom fields with tags, or something like that, to limit the tags a user can post to.

But the underlying hope is what I’ve mentioned–I can take care of a lot of the subforum setup on my app’s end, but it would save me a lot of time to still be able to use discourse’s posting functionality.

I appreciate all the replies. Would someone be able to provide some examples of how user custom fields are normally used?

It seems like I could just add a custom field related to the given subforum (say, ‘subforum123’) to each permitted user, and then when a user goes to a subforum page hit the api to see if the user has the required custom field. If yes, then they can post there. If no, then they cannot, and perhaps I just hide the “new topic” and “reply” buttons.

They are generally used to collect information (location, job title etc) at sign up which is displayed on the profile card.

4 Likes

Maybe what you want to do is to make it so that people could create their own discourse (e.g., username.yoursite.com) that runs on a multisite installation that has your “home” discourse as the SSO server for the user sub-site. You could conceivably create a plugin that would create a new username.yoursite.com discourse site whenever a new user got created. But maybe every user doesn’t want their own sub-forum and you’d instead have . . . something . . . that would let them create their sub-site.

I think that’s starting to get close to what you’re trying to do.

That is indeed getting close to what i have in mind (“subforums” has been the goal). Thanks. I’ll look more into multisite.

I would have thought that allowing users to create their own sub-site in a multisite structure would be a fair bit more resource intensive than, say, allowing users to create their own categories. Could a multisite work with hundreds or more sub-sites? I’m wondering how much drain that would be on the server, or perhaps its not much more drain than a busy single site?

It is, but it has the advantage of being possible.

Yes, I am aware of at least one company that has hundreds or more sub-sites with at least two different sets of plugins at $100-$300/month. Others charge $20/month per site.

In case it’s not clear, you’re basically building a Discourse hosting company.

You’ll want 4-16GB of ram to start for, say, a few dozen sites.

To confirm, do you mean that company pays $100-$300/month to maintain hundreds of subsites? (seems that is what you are saying–that’s a pretty low amount for hundreds of subsites)

I mean that one company (the one that develops Discourse) charges $100-$300/site that you’re looking to create. Some others charge on the order of $20/month; presumably they are happily making money.

It’s probably at least hundred hours to solve the problem that I have proposed. But likely more.

EDIT: But maybe if you just want a single multisite you could get it started in less time than that.

1 Like

Ok. Got it. Thanks for the info.