As it currently stands, this component will make one ajax request per loaded post. This can add up depending on your hosting situation and community size, so please keep that in mind as you consider installing this component. It’s clear that there is a good amount of interest in this feature, so hope to improve the situation as time permits.
Post Badges will add earned badges next to a post author’s username. Specific badges to display can be adjusted through a theme setting.
Hovering over the badge will show a tooltip with the badge’s description.
Clicking on the badge will take a user to the badge’s overview page
Some default badges contain links in their descriptions. These will not display nicely as a tooltip, so it is recommended to customize the description at /admin/customize/site_texts. You can find what you need to modify by searching for part of the description’s current text.
After using this component for a few days I feel it’s not quite production-ready yet: it’s really hammering my server with lots of requests and slowed down the entire site. Also, on larger topics I saw lots and lots of 429 response codes in the console as it was querying the badges of each individual poster.
I really love the idea here and so does my community, but I think it could use a little more TLC first
The intended behavior was to only make one request per user, per full-page load. This means if you have a topic with 1000 posts and 8 participants, there would be 8 requests max. If you went to another topic (without a full-page load) that had the same 8 participants and 2 new participants, there would only be 2 requests.
I think I’ve have a fix to accomplish the intended behavior, but I need to do some more testing. Stay tuned.
PS - The end goal will be to have 0 requests, but there is a limitation with components that prevents this for now.
When showing a badge in the topic view, I can already see that a specific user has a specific badge, making the click-through feel redundant. I prefer the previous behavior of clicking through to see all users with a specific badge, as it quickly gives me additional information instead of just a different view of the same user.
Thanks for your work, our community very much enjoys this!
I’ve been attempting to move where the post badges display on posts. The approach I’m trying to take is creating a div above the post controls, and popping the css in there but I’m not super great with web design. If anybody has a suggestion on how to do this, I’d very much appreciate it, please and thank you!
This is excellent, thank you so much! Would love to be able to have users decide which badges they’d want/not want displayed on an individual level in the future - totally understand if this isn’t feasible though.
Sorry for the delayed response. It was a busy week last week and I didn’t get an opportunity to work on this component.
This is priority #1 regarding this component. Going to do my best to nail down a viable solution, hopefully this week.
Sure, I’ll work on making the badge linking a little more flexible.
This is definitely a more challenging request. I don’t think it can be done with the current limitations. I agree it would be a pretty cool feature, though. Definitely noted, but I’m not sure if/when this will happen.
Alright, I finally have an update Things should be in a much better place as far as server requests go (@bartv) . I’ve also added a basic setting to choose between the badge overview page and the user’s badge page for the badge links (@FoohonPie). No optional per-badge parameter yet.
Please let me know if you notice any issues. I tried to test things as best as I could, but you never know. The capabilities of themes continue to grow, so hopefully I’ll be able to continue to improve the implementation over time.
Thanks for the report! I reverted the request reduction attempt for now as it was causing a different issue. This was one of those lovely “fix one thing, break another” situations. It’s proving quite challenging to get everything perfect.
I was hoping to get something in place by the weekend, but clearly there are still some kinks to work out
This is an essential component that should be part of the core.
Sometimes the badges show, sometimes they don’t. I haven’t found the rhyme or reason- my best guess is that they don’t show toward the end of longer topics. On refresh, they might show. Apologies if this is re-phrasing the “request reduction” issue listed above.
I think I’ve made it as efficient as I can at this point. I tested as many scenarios as I could think of, and it looks to be in much better shape. Please update the component from your admin dashboard and let me know if you run into any issues.
Thank you to everyone for their patience and interest with this component
Haven’t ran into any problems, however, I do have a suggestion! Maybe a way to display all badges instead of having to list them specifically? I’ve got a setup where people really want to display all badges they have, but I don’t like how messy it is to have to include every badge explicitly. Just an idea!
Maybe something as simple as an asterisk as a wildcard (and this opens up the opportunity to include all custom badges easily by prefixing/suffixing their names and using a wildcard to discern which badges to include).
Great work though! Extremely satisfied that someone did this (and very elegantly too).