Skip to main content

Earn points template

Description

The earn points template displays information about available behaviours that users can perform to earn points. This template can be triggered from multiple widgets including the Header, Profile, Leaderboard and Activities Widgets.

Control classes

The following control classes determine how the earn points template functions:

ClassDescriptionRequired
mambo-ctrl-closeHides the Earn Points widget when clicked, using a right-to-left slide animation in reverseNo
mambo-ctrl-earnIdentifies the container element for the earn points widget. Elements with this class animate into the screen from right to leftNo
mambo-ctrl-earn-headerIdentifies the widget header element, used to calculate proper widget height for scrollbar renderingNo
mambo-ctrl-earn-contentIdentifies the core content container, used for scrollbar renderingNo

Template data

The template receives the following data:

VariableDescriptionType
dataArray of behaviours that can be performed to earn points. Always check the hideInWidgets property before displaying behaviours to avoid revealing surprise behaviours. For detailed behaviour object structure, see the Behaviours API documentationArray
isLoadingFlag indicating whether the behaviour list is still loading. When true, you should display a loading indicator. The template will re-render automatically once loading completesBoolean

Implementation example

This example shows a custom earn points template with basic styling and loading state handling:

JavaScript

Customisation options

You can enhance the earn points template by:

  • Adding icons or images to represent different behaviour types
  • Including point values for each behaviour
  • Grouping behaviours by categories
  • Adding tooltips with additional information about each behaviour
  • Implementing a search or filter function for larger behaviour lists