Wagtail Paginated Subpages
A simple Django Wagtail app to add paginated pages under a root page using a mixin /template tag approach.
Adds paginated urls under and page where the mixin is used:
/the-original-page/ /the-original-page/page/1/ /the-original-page/page/99/
Quick start
Install “wagtail-paginated-subpages” using pip:
pip install wagtail-paginated-subpages
Add “wagtail_paginated_subpages” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'wagtail_paginated_subpages', ]import the mixin and include it before the Page (or other) classes:
from wagtail_paginated_subpages.mixins.pagination import PaginatedMixin class ContentPage(PaginatedMixin, Page): passUse the paginated content in a paginated page template:
<ul> {% for page in paginated_objects %} <h2>{{ page.title }}</h2> {% endfor %} </ul>Use the pagination template tag to add pagination:
{% load wagtail_paginated_tags %} {% render_pagination page=page paginated_objects=paginated_objects %}Navigate to page with child pages and list of child pages should be present
Customisation
By default page 1 is automatically redirected to the base page url (for SEO). This can be updated to redirect the base page to /page/1/ if preferred:
PAGINATION_REDIRECT_INDEX_TO_ROOT = True # redirects /page/1/ to page.url PAGINATION_REDIRECT_INDEX_TO_ROOT = False # redirects page.url to /page/1/
Pages are paginated by 12:
PAGINATION_PAGE_SIZE_DEFAULT = 99 # Number of items per page
Page size options to show in the ‘Show:’ list:
PAGINATION_DEFAULT_PAGE_SIZES = [12, 24, 48, 96] # Options for page sizes
By default the mixin returns all child pages for the current page, however this query can be changed by defining a get_child_page_queryset:
class ContentPage(PaginatedMixin, BaseCMSPage):
def get_child_page_queryset(self):
return self.get_children().live().order_by('-first_published_at')
Pagination markup can be customised by creating a new template in:
templates/wagtail_paginated_subpages/pagination.html
By design the list of child pages has not been designed as a template tags as there are too many ways to style the lists of content for it to be worthwhile. These can be updated by simply updating the markup from step 3.
Canonical meta tags can be added to the page header using:
{% load wagtail_paginated_tags %}
{% render_pagination_meta page=page paginated_objects=paginated_objects %}
Metadata
Release files for wagtail-paginated-subpages 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wagtail-paginated-subpages-0.6.1.tar.gz | 5.3 kB | Without provenance | Details for wagtail-paginated-subpages-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wagtail_paginated_subpages-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for wagtail_paginated_subpages-0.6.1-py3-none-any.whl |
Total release size: 15.0 kB
Release files / wagtail-paginated-subpages-0.6.1.tar.gz
| Download URL | wagtail-paginated-subpages-0.6.1.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4099a7e430c4a4e0568b9ba44255007b8dc79ca4ff3fe8366741398cac1f947
|
|
BLAKE2b-256 checksum How to use checksums |
cf351322929d56a74cb5af66b6eb56f066291a5d5eeca8e555507ec7ac56db2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / wagtail_paginated_subpages-0.6.1-py3-none-any.whl
| Download URL | wagtail_paginated_subpages-0.6.1-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8c13fc4775f2275fbf59b930f9719608570b2ea4209cfd1813f19f93746bb2f
|
|
BLAKE2b-256 checksum How to use checksums |
e3fae9f2996c8ae0973c3ee3a4127967a10bd7b7793a18e3f16bb5c4bbf79c37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for wagtail-paginated-subpages 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.