Forum Discussion

Gursimrat's avatar
Gursimrat
Leader
11 years ago

Custom Badges for community

Hello, We have a requirement wherein we want to setup a custom badge widget, which will accumulate the badges based on the type of activities users perform. This will work just like how Lithium'd badges work, but as we dont have them enabled, and need our custom, I am wondering we can achieve this if we have some API which gets us the result of all the activities which user is performing. Lets say, an API which returns

 

No. of visits, so if they are > 100, user earns a regular visitor badge

No. of kudos given > 10, some kudo badge

No. of kudos recieved > 10, some xyz badge

No. of replies made > 25, some badge 

 

Can we achieve something like this? or do we need to involve lithium services? In my opinion, if I get such user info/ details, we can create this. Please suggest and also provide any such API.

 

Thanks

 

  • Hey,

     

    So my first suggestion would be to push you towards the Premium Gamfiication Package as this would give you want you need and more "from what i have seen" however it does come at a cost which may not be possible for some. It is possible to do what your after with dev but its not a slick as the above option, i am sure there are other ways but the way i would tackle this would be with the use of roles. 

     

    You could create a different role and image for each of the "badges" you want to assign, the actual badge you would store in your assets library, you would then need to create a custom component which you would place in the forum topic page "I believe" which displays the given badge(s)  if any of the set roles are granted to that user. I am currently doing this to display a single badge.

     

    Your next step would be to use the api's to identify users that meet your criteria and then grant the role, I know you can grant a role via the api but not 100% if all of your triggers can be done via api but i suspect they can as you can do almost anything with them. You can find all the info on the api's in the REST API area. Sorry i cannot be more specific on the api front, i am still getting to grips with them :)

     

    Thanks 

    • Gursimrat's avatar
      Gursimrat
      Leader
      Thanks Stephen.

      Yes, I am on similar thinking grounds as you have mentioned, using the users activities details mashed up with the roles, ranks and club them to achieve final badges. Only limitation over here is that we can not make it configurable from admin and would require to update the code for any changes in criteria of earning a badge, other than that, do you see any challenges here?
      • Fellsteruk's avatar
        Fellsteruk
        Boss
        Yeah it would be messy, the only thing that could be managed via admin is the adding and removing of the badges "roles"

        I dont see any challenges "as such" but as you start your demand within the community for more badges will grow "this is a good thing" but this method isn't the most scalable as you could end up with 100's of roles :(