1. Documentation
  2. Tutorials
  3. Creating a Rank Type

Creating a Rank Type

Let’s to see a real world example of a rank type creating and configuring the Level rank type and awarding levels to our users for logging and commenting on a specific page.

Also let’s to see how to announce to the user the existence of this levels, the requirements to earn them and finally a page with the current level rank.

1 – Creating the Level Rank Type

Access to your WordPress admin area, normally located in your_site_url/wp-admin.Navigate to GamiPress -> Rank Types menu (This view is really similar to the WordPress post/pages views).

At the top of this view you can find a button to add a new rank type.

Let’s to configure our new rank type with the next data:

If everything went well, a Ranks menu with the Levels sub menu should appear before the GamiPress menu.

2 – Creating Levels

Unlike achievement types, rank types has a different workflow. When you create achievements of an achievement type, user can earn any achievement just meeting the achievement requirements.

Rank types adds a new “hidden” requirement that an user needs to meet to start completing any rank requirements: The user needs to complete first the previous rank.

Ranks order is set by the priority field and his workflow is similar to the WordPress page’s menu order field.

For our Level (rank type) we need to start setting up new levels (ranks) to award to our user. So let’s to create our first level with the next set up:

This will be our first level with a priority set to 1.

GamiPress set as default rank the lowest priority rank for each rank type, so the first rank can be created without requirements.

Now, lets to create a new level rank with the next set up:

As you can see, GamiPress will set by default the next priority based on the highest priority registered. How our highest priority registered is 1, GamiPress set next priority to 2.

Also, the rank details box will add links to the next and previous ranks to let you access them easily.

For more information about setup ranks, see the Rank Types documentation page.

3 – Adding requirements to our level

The unique way an user could earn this rank is performing the actions configured on the rank requirements. This requirements are located on the rank edit screen (after the “Rank Data” box).

Clicking on the Add New Rank Requirement button you can add as many requirements as you want.

Let’s to configure one requirement to force to the user to log in to the website at least one time:

4 – Announcing our Levels and how to earn them

GamiPress has the [gamipress_ranks] shortcode that allows you to show all or a specific rank type, so creating a page with [gamipress_rank type="level"] will show something like this:

When an user performs any of the actions configured on levels requirements, the requirement will appear strikethrough:

As you can notice on the screenshot, if the user has completed all the requirements, the rank will look different.
Note: Also you can show just a rank using the [gamipress_rank] shortcode or adding a link to the rank itself like you can do with a WordPress post/page.

Was this article helpful to you? Yes 2 No

How can we help?