Skip to main content

Embed the leaderboard

You can use a shortcode to add the leaderboard to Moodle content. Learners can then see the leaderboard without opening the leaderboard page.

Prerequisites​

You must install and enable the Shortcodes plugin to use shortcodes with Level Up XP.

Embed the leaderboard​

  1. Go to the leaderboard page.
  2. In the page menu, select Embed leaderboard.
  3. Copy the shortcode from the dialog.
  4. Paste the shortcode into a Moodle text editor. For example, add it to a course section summary, a block, or a page resource.

The shortcode has the following format:

[xpladder ctx=123 secret=abcd1234]

Level Up XP generates the ctx and secret parameters for the correct context. Do not write the shortcode manually.

Options​

To change the leaderboard display, add parameters to the shortcode:

  • top displays the top users instead of the users near the current user. You can specify the number of users, such as top=10.
  • hidelink hides the link to the full leaderboard page.
  • withprogress adds the progress bar column if you enable the column in the leaderboard settings.

For example:

[xpladder ctx=123 secret=abcd1234 top=10 hidelink]

See the shortcodes reference for the full list of options.

Team leaderboard​

This feature requires Level Up XP+.

You can also embed the team leaderboard. Go to the team leaderboard page and follow the same procedure. Level Up XP generates an [xpteamladder] shortcode for the team leaderboard.