A new feature in CKAN 2.0 enables you to add custom previews for different file types.
CKAN's ability to preview resources gives users a quick way to check if they have the dataset they need - as well as to begin to explore the data. CKAN has built-in previews for certain filetypes, such as images and CSV files. However, if you have resources in another format, users cannot preview them. Custom previews provide a simple way to add previews for more filetypes, or even modify existing preview methods.
[caption id="" align="alignleft" width="320"]
Map preview of CSV file in CKAN[/caption]New previews can be build as a CKAN extension with the help of the
Map preview of CSV file in CKAN[/caption]New previews can be build as a CKAN extension with the help of the IResourcePreview interface. This is the same interface as CKAN already uses for built-in previews. (Note that, while most of these are enabled by default, the built-in PDF preview is not. To enable PDF preview, you need to edit the CKAN .ini file and add pdf_preview to ckan.plugins.)
A preview extension must implement three methods:
can_previewto indicate that it can preview the dataset,preview_templateto return the template for the preview, andsetup_template_variablesto add the data that should be rendered to the template.
ckanext. If you have any questions, let us know on the mailing list and we'll try to help.
More posts
In Category on 20 Mar 2026
LLMs + Open Data Portals: Join the CKAN Answers Consultation Session
Are you building systems that query open data portals with AI? How are you handling retrieval reliability, hallucinations, and grounding? Join a semi-closed technical session organised by the OKFN Tech Team around the CKAN Answers project β demo, code sharing, and community feedback.