{% macro pagination_nav(pag, page_param="page", extra="") %} {# pag is {} when the underlying table is missing: render nothing instead of failing #} {% if pag and pag.last_page is defined and pag.last_page > 1 %} {% set _sep = "&" if extra else "" %} {% endif %} {% endmacro %}