Paginate the resource list on CKAN dataset pages with configurable page sizes
Project description
ckanext-resource-pagination
A CKAN extension that adds pagination to the resource list on dataset pages.
CKAN renders every resource on a single page by default. For datasets with hundreds or thousands of resources, this crashes the browser and makes pages unusable. This plugin paginates the resource list with configurable page sizes and Bootstrap 5 navigation controls.
Features
- Paginates the resource list on dataset detail pages (
/dataset/<id>) - Configurable number of resources per page (default: 50)
- Only processes visible resources (skips
resource_view_listcalls for off-page resources) - Bootstrap 5 pagination controls with windowed page numbers
- "Showing X-Y of Z resources" counter
- Works with all dataset types
- No database changes or migrations required
Requirements
- CKAN 2.11+
- Python 3.8+
Installation
pip install ckanext-resource-pagination
Add resource_pagination to ckan.plugins in your ckan.ini:
ckan.plugins = ... resource_pagination
Restart CKAN.
Configuration
| Setting | Default | Description |
|---|---|---|
ckanext.resource_pagination.per_page |
50 |
Number of resources to show per page |
Example:
ckanext.resource_pagination.per_page = 25
How it works
The plugin registers a Flask blueprint via IBlueprint that intercepts the dataset read route (/dataset/<id>). The view:
- Calls
package_showto fetch the dataset (standard CKAN behavior) - Reads the
resource_pagequery parameter from the URL - Slices the resources list to the configured page size
- Only calls
resource_view_liston visible resources - Passes pagination metadata to the template
The plugin also overrides package/read.html and package/snippets/resources_list.html to render the sliced resource list with pagination controls.
License
AGPL-3.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ckanext_resource_pagination-0.2.3.tar.gz.
File metadata
- Download URL: ckanext_resource_pagination-0.2.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ccecaa4b5585163c4d0e344c43fe174740b8206180e48b41a4226155df26543
|
|
| MD5 |
986fedf2380780b502c0ac53a432ce55
|
|
| BLAKE2b-256 |
c2a20c6376ae299e4087f11ffe5f79a608e0b9556163bde7ccaceaf1b9f3facc
|
File details
Details for the file ckanext_resource_pagination-0.2.3-py3-none-any.whl.
File metadata
- Download URL: ckanext_resource_pagination-0.2.3-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8634423313e140cf82ea94dcbaff0879155e04e00aa30ed386ec1e0a4205886d
|
|
| MD5 |
de8087b9910daa2b442acb1597dc7ab4
|
|
| BLAKE2b-256 |
f93abb026a45f59b1b3ffcf47b2615ec94b6429eb194a57e3df1c2943df8de82
|