Skip to main content
You can use all_lessons to access a lesson by its ID. This returns the Lesson object for the specified lesson. If the lesson isn’t found, then null is returned. The all_lessons object is decided on runtime, so it’s not a static object. It’s different for each user, based on what group they belong to, if they’ve classes unlocked now, etc.

Syntax

{{ all_lessons[lesson_id] }}

Scope

It’s accessible globally, in any template, section or block.

Example

{{ all_lessons["my-lesson"].name }}
// Just an example initial data, the data is not real
{
  "all_lessons": {
    "my-lesson": {
      "name": "How to make an apple pie"
    }
  }
}
How to make an apple pie