I’m trying to add self-service pronoun badges for my discourse, and not sure what the best way to go about it is. Seems like self-service badges don’t exist yet, so I’d have to hack something up.
Best idea from a UX point of view is maybe create a special post and people could reply to the post with the pronouns they prefer, and a sql query could then find the reply and assign the right badge?
Is there something simpler than that, that I haven’t thought of?
I’m not quite sure exactly what you’re trying to accomplish, but you can create a custom user field and have people put their pronoun(s) there.
What do you mean by a “badge”? Discourse has Badges, but I don’t think that’s what you mean, or maybe it is. If you do mean badges, then you can enable Badge SQL and have them be assigned when someone populates the pronoun field in their profile.
Ahh, a custom pronoun field in profile is a good start. The problem is that I’m generally not going to go look at someone’s profile before responding to them.
The reason I was thinking of doing it as a badge is to make it so it’s more visible… There’s “Allow badge to be used as a title” … which I presume means you can have it shown up by someone’s name… but maybe not?
Hmm, yeah, I tried it on the card, that’s not bad. I was thinking after the user’s primary group… but I worry that is making that line pretty busy. Also I don’t relish tweaking the theme.
That’s my concern. Do all of your users really want to scream their pronouns on every. single. message? And coming up with groups has its own set of problems, as you’ll necessarily be limiting the set of pronouns that people can use. The CSS solution could stick the value from the custom field after their name and/or primary group. I don’t relish doing CSS stuff either, but my guess is that you can get someone here to tell you how to do it. Worst case, it’s a few hundred dollars, I’d think.
No, just create a theme component and add that code (modified for your custom variable) and add it to the </head> section of the theme component. Then add that theme component to whatever theme(s) you are using.
For those, like me, who didn’t know how to make a theme component, you can do it right from your site, just go to Themes under settings, and click the component tab, click install, and then click create. Bam.
(Clicking install to create a new one was weird, but I figured it out).
Ok, uh, is there a trick to get it to… work? It looks correct when I click preview, but it’s not taking effect on the site as a whole. I don’t know what the difference is? I created it and it says it’s enabled. I don’t see the actual script in the source of either page, but I presume that’s some html/javascript magic.