{% if current_page.parent_page.parent_page.course%} {# Course run placed below a snapshot #} {% for ancestor in ancestors %} {% endfor %} {% else %} {# Course run directly placed below its course #} {% for ancestor in ancestors %} {% endfor %} {% endif %}