{# collection #} {% set total = collection.data | length %} {% set pos_first = collection.pager.start + 1 %} {% set pos_last = pos_first + collection.pager.size - 1 %} {% set current_page_number = collection.pager.page %} {# if first item is greater that total number of items, somebody is messing with pagination. Send them to the beginning of the list #} {% set prev_page_number = [current_page_number - 1 if pos_first < total else 1, 1]|max %} {% set next_page_number = current_page_number + 1 %} {% block page_size_switcher %}