Overrides the index view of cmsplugin_blog's urls.py in order to provide pagination for that view.
Python
Switch branches/tags
Nothing to show
Pull request Compare This branch is 2 commits ahead, 5 commits behind bitlabstudio:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cmsplugin_blog_paginated
AUTHORS.rst
MANIFEST.in
README.rst
setup.py

README.rst

cmsplugin_blog_pagination

Adds pagination to the index view of your blog.

This app is an add-on to the fantastic cmsplugin_blog application.

Prerequisites

  • Django
  • django-cms
  • cmsplugin_blog

Installation

pip install -e git+git://github.com/bitmazk/cmsplugin_blog_paginated.git#egg=cmsplugin_blog_paginated

Configuration

Add BLOG_PAGINATE_BY to your settings.py. Default is 10.

Use the Blog Paginated Apphook instead of the normal Blog Apphook in the administration.

Usage

Your archive_index.html will now be served by a ArchiveIndexView. Therefore you have access to a context variable named page_obj, as documented here.

A simple paginator could look like this:

<div>
  <span>
    {% if page_obj.has_previous %}
      <a href="?page={{ page_obj.previous_page_number }}">previous</a>
    {% endif %}

    <span>
      {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
    </span>

    {% if page_obj.has_next %}
      <a href="?page={{ page_obj.next_page_number }}">next</a>
    {% endif %}
  </span>
</div>

License

The Unlicense