You can use all_courses to access a course by its ID. This returns the Course object for the specified course. If the course isn’t found, then null is returned. The all_courses 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_courses[course_id] }}

Scope

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

Example

{{ all_courses["my-course"].name }}
Cooking 101