The discussion revolves around displaying badges on topic pages that have earned them. pfaffman wants to showcase badges at the top of the topic page, like the subject line, to let learners know they have successfully completed a challenge. sam believes this is not possible with just CSS and would require a plugin.
However, ccdw suggests a two-stage process using tags, jQuery, and CSS to add badges to the topic page. pfaffman currently uses a similar method, where badges are assigned based on tags and likes, but wants to display these badges on the topic page. He is close to automating this process via API query. The goal is to make it visible to users when a post has earned a gold or silver badge, providing a way to showcase earned badges on the topic page.
In my quest to make Discourse a first rate learning platform, I use badges to let learners know that they have submitted something and to show that they have successfully completed the challenge. It would be cool if a topic that had earned a badge had the badge prominently displayed at the top of the post, like the top where the subject is.
Is that possible with just CSS, or would that take a plugin?
If you are happy with a two stage process then I guess you could add a tag to the badge winning topic and then target that tag and add the badge with a mix of jQuery and CSS or just CSS if you placed the badge in the same Dom fragment as the tag. Note, with CSS you can add text and graphics only.
A nice bonus would be that you could list all, for example, gold star topics by selecting the gold star tag.
Edit. Couldn’t you also start by tagging the topic and then award the badge to the pupil by badge script based on the topic having that tag? Wouldn’t that one tagging action create a badge on the topic and award it to the pupil too?
This is what I do now. I have a set of badges whose SQL assigns a bronze badge when they post in a “completions” category with a certain tag. A silver badge is assigned when I “like” their response, and a gold badge is assigned when they get a certain number more likes. I am about to get that process automated. What I’m looking for now is a way for those badges to be displayed on the topic page that awarded the post. It would be nice if when someone saw a post they could see that it had earned a gold or silver badge.