{% load cotton_ui %} {% if page_obj is not None %} {% comment %} Auto mode: given a Django Page object, render prev / elided page numbers / next. Pass the compositional sub-components in the slot instead for full control. {% endcomment %} {% for num in page_obj|elided_page_range %} {% if num == "..." %} {% else %} {{ num }} {% endif %} {% endfor %} {% else %} {{ slot }} {% endif %}