Skip to main content
You can use the last_watched_lessons list in conjunction with all_lessons object to create a “continue watching” or “recommended content” section.

Syntax

{% last_watched_lessons.first %}

Scope

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

Example

{% for lesson in last_watched_lessons %}
  {% assign lesson_data = all_lessons[lesson] %}
  - {{ lesson.name }}
{% endfor %}
// Just an example initial data, the data is not real
{
  "all_lessons": {
    "lesson-a": {
      "name": "Introduction"
    },
    "lesson-b": {
      "name": "Advanced Course Intro"
    }
  }
  "last_watched_lessons": [
    "lesson-a",
    "lesson-b"
  ]
}
- Introduction
- Advanced Course Intro