Skip to content

*DISCONTINUED* Overrides the index view of cmsplugin_blog's urls.py in order to provide pagination for that view.

Notifications You must be signed in to change notification settings

bitlabstudio/cmsplugin_blog_paginated

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important

This app has been discontinued and is no longer maintained.

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

About

*DISCONTINUED* Overrides the index view of cmsplugin_blog's urls.py in order to provide pagination for that view.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages