HubDb Simple PRev & next Pagination

{{ module.title }}

{% set category = "&category=" ~module.category %} {% set table = hubdb_table_rows(module.hubdbtable_field , category) %} {# set the number of items per batch #} {% set batch_num = 6 %} {# set the number of pages #} {% if table|length % batch_num == 0 %} {% set number_of_pages = (table|length|divide(batch_num) %} {% else %} {% set number_of_pages = (table|length / batch_num) %} {% endif %} {# set the active batch #} {% if Query.page_num %} {% set page_num = Query.page_num %} {% else %} {% set page_num = 1 %} {% endif %} {% for row in table|batch(batch_num, '') %} {% if loop.index == page_num %}
{% for innerRow in row %} {% if innerRow.name %} {% endif %} {% endfor %}
{% endif %} {% if loop.last %}
{% if page_num > 1 %} Previous {% endif %} {% if page_num < number_of_pages %} Next {% endif %}
{% endif %} {% endfor %}

Comments

Popular posts from this blog

Numbered Pagination in HubDB

Dynamic Pages Number Pagination in HubDB (Listing)

Tabber in Tabber