Making the switch to a new CMS is always a bit daunting. The community is sometimes not well established and plugins aren’t always available for quick development. But when we moved over to using Craft CMS, we found that it could handle pretty much everything we threw at it (And did a better job than others...) the community (Especially via Slack and Stack Exchange) is amazing and if Craft CMS couldn’t handle something - there would be a plugin available. We were impressed.
But recently we had two projects that required some unusual functionality.
Both projects needed to extend the user functionality to create a points / trophy system. After a quick Google, and a look on Straight Up Craft the results were in… There was nothing available.
What is Points?
Points allows you to add a bit of fun functionality to your website / web app by rewarding users and creating a point / trophy system. Rewarding users for ‘Events' - such as subscribing to a mailing list, sharing an article or logging in for the first time.
- Control Panel
Events and Entries (Points) assigned to users can be managed via TWIG template tags, or they can be added via the control panel inside Craft. Making it easier for site admins to add, edit or remove points.
- Events on the Fly
Events such as signing up to a mailing list or updating a users profile etc generally need to be created before you can assign these to a user. But if you want to make this work dynamically, such as assigning points for every article a user reads, you can do this on the fly.
Events can generally only be assigned to a user once. But if you want a user to be able to perform the same event multiple times then you can do this also! For example, you will only allow a user to gain points only once if they register. But you may want to allow them to gain points multiple times if they share multiple articles.
- User Total
Once a user has a few points assigned to them, you can output their total, to show them their achievements.
Everybody loves a dashboard widget, so we added one that lets you see which users last gained points.
We plan on developing this plugin further by adding a few other functions:
- More Widgets (Who doesn’t like more Dashboard Widgets!)
- Delay e.g. Points can only be grabbed every X hours.
- Hook to create events automatically after Section Entries are created
- Grouping Points in to ‘Badges'
Overall, we were surprised at how simple building Craft CMS plugins was once we got our heads around the file setup and some terminology. If you have any suggestions for this plugin, write an 'Exhancment' on Github Issues for the project, or via the Disqus below. We already have a few more plugins cooking. Watch this space.