Login

Pagination Django with Boostrap

Author:
guilegarcia
Posted:
October 11, 2015
Language:
HTML/template
Version:
Not specified
Tags:
pagination boostrap
Score:
0 (after 0 ratings)

Create a list of pages using Django 1.8 and marks the current page. Using Bootstrap. * "list_itens" is a list of itens paginated.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{% if num_pages %}
                <ul class="pagination">
                {% for num in num_pages %}
                    {% if num == list_itens.number %}
                        <li class="active"><a href="?page={{ num }}">{{ num }}</a></li>
                    {% else %}
                        <li><a href="?page={{ num }}">{{ num }}</a></li>
                    {% endif %}
                {% endfor  num_pages %}
                </ul>
            {% endif %}

More like this

Comments

Please login first before commenting.