Django Twitter Bootstrap 3 pagination

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{% if is_paginated %}
        <ul class="pagination pagination-centered">
            {% if page_obj.has_previous %}
                <li><a href="?page=1"><<</a></li>
                <li><a href="?page={{ page_obj.previous_page_number }}"><</a></li>
            {% endif %}

            {% for i in paginator.page_range %}
                <li {% if page_obj.number == i %} class="active" {% endif %}><a href="?page={{i}}">{{i}}</a></li>
            {% endfor %}

            {% if page_obj.has_next %}
                <li><a href="?page={{ page_obj.next_page_number }}">></a></li>
                <li><a href="?page={{ page_obj.paginator.num_pages }}">>></a></li>
            {% endif %}
        </ul>
    {% endif %}

More like this

  1. Django-pagination with Bootstrap CSS by ronbeltran 1 year, 11 months ago
  2. Custom Form Example: Forms for Bootstrap Html - CSS Toolkit by fatiherikli 2 years, 4 months ago
  3. cron/console bootstrap django by nstrite 6 years, 8 months ago
  4. Simple Paginator Function by goodsanket 4 years, 2 months ago
  5. Pagination Template Tag by ioan1k 4 years, 7 months ago

Comments

(Forgotten your password?)