A user seeks to display their gamification points from the Discourse Gamification plugin in the site header, specifically showing their total points from the leaderboard. After discussion, they successfully implement a solution by creating a custom component using the Discourse API to fetch and display the score in the header. The code dynamically adds a score container with a gold icon and points value, ensuring it appears only for logged-in users. The user shares the working implementation and a test site trgala.com for reference. TRgala_Murat explains the method, while NateDhaliwal and merefield provide guidance on using theme components and plugin outlets like before-header-panel.
Hello, I’m trying to do something. I want to display the user points from the Discourse Gamification plugin at the top of the site. For example, if a user named Adam has 700 points, how can I show this in the header section? Where should I place the code?
I mean, what I really want is for the user to see their own points.
Best regards!
This request is quite excellent; I am also curious to know the answer.
I believe that if each user could see their contribution points under their name tag, it would greatly enhance community engagement.
“I want to move the Cheer Points from the user cards to the top of the homepage. The user should be able to see their score. These scores are taken from the leaderboard.”
I want to move the Cheer Points from the user cards to the top of the homepage. The user should be able to see their score. These scores are taken from the leaderboard.
No sir. The user should only see their score in the header. I need to add the section that is added to the profile card to the header. This score is obtained from the leaderboard, which reflects the points earned from task
Each user should see their score in the header section on the homepage. If there is a code or method to do this, please let me know. I’ve been struggling for 14 hours, and I’m fighting with my cat!
There are loads of examples of Components. Look at the codebases of Customization > Theme component to look at examples of .gjs glimmer Components and note how they are attached to Plugin Outlets.