{% extends CMS_TEMPLATE %} {% load i18n l10n sekizai_tags cms_tags pcart_core thumbnail staticfiles %} {% block title %}{% page_attribute "page_title" %}{% endblock %} {% block base_content %}

{% page_attribute "page_title" %}

{% for article in articles %} {% endfor %}
{% if articles.has_other_pages %} {% with p_url=request.get_full_path %}
    {% if articles.has_previous %}
  • «
  • {% else %}
  • «
  • {% endif %} {% for i in articles.paginator.page_range %} {# if we're beyond the first five pages, just show "..." until three pages before the current page #} {# e.g. on page 12 show: "... 9 10 11 12" #} {% if articles.number > 5 and i < articles.number|subtract:4 %} {% if i|subtract:3 <= 0 %}
  • {{ i }}
  • {% endif %} {% elif articles.number > 5 and i == articles.number|subtract:4 %} {# show '...' #}
  • ...
  • {# if we're before the last five pages, just show "..." for pages more than three after the current page #} {# e.g. on page 1 of 10 show: "1 2 3 4 ..." #} {% elif articles.number < articles.paginator.num_pages|subtract:5 and i > articles.number|add:4 %} {% if i|add:3 > articles.paginator.num_pages %}
  • {{ i }}
  • {% endif %} {% elif articles.number < articles.paginator.num_pages|subtract:5 and i == articles.number|add:4 %} {# show '...' #}
  • ...
  • {% elif articles.number == i %}
  • {{ i }} (current)
  • {% else %}
  • {{ i }}
  • {% endif %} {% endfor %} {% if articles.has_next %}
  • »
  • {% else %}
  • »
  • {% endif %}
{% endwith %} {% endif %}
{% endblock %}