[ckan-dev] Use existing snippet for showing latest datasets

Henrik Aagaard Sørensen BU1G at tmf.kk.dk
Tue Jun 17 13:21:04 UTC 2014


I've created my own extension, with an addon for getting the latest datasets in plugin.py.

I would like to show this on the frontpage via an existing snippet. But using package_list or similar fails.

The function for retrieving the latest datasets follows the docs on http://docs.ckan.org/en/latest/theming/templates.html, for most popular groups, just changed:

toolkit.get_action('group_list')

to:

toolkit.get_action(package_list')



and

sort': 'packages desc

to:

sort': 'metadata_created desc

This seems to return the latests datasets (packages). But using package_list snippet or similar for this results in a fail.

I'm running CKAN 2.2.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140617/129d26ab/attachment-0002.html>


More information about the ckan-dev mailing list