ckanext-datasetsnippets
This plugin belongs to a set of plugins for the Datenregister – the non-public CKAN instance that is part of Berlin’s open data portal daten.berlin.de. ckanext-datasetsnippets provides markup snippets for dataset pages and dataset search. These snippets can be loaded from the data portal’s public CMS to handle all requests for datasets.
Requirements
This plugin has been tested with CKAN 2.9.10 (which requires Python 3).
API
The Snippet API has the following two endpoints:
/snippet/dataset
This is the search endpoint of the snippet API, which is equivalent to /dataset in the regular CKAN UI. Without additional parameters, this returns markup for the paginated list of all datasets. Parameters (search facets, ordering etc.) can be used to restrict the result. The parameters are identical to the regular CKAN search parameters.
/snippet/dataset/<id>
This is the dataset detail endpoint of the snippet API, which is equivalent to /dataset/<id> in the regular CKAN UI. <id> is the name or id of a dataset.
Parameters
Both endpoints allow a root_breadcrumb parameter to set the root element of the breadcrumb returned in the snippets.
Configuration
The plugin introduces the following configuration options:
# Defines the path component prefixed to links in snippets
datasetsnippets.path = 'datensaetze'
# Datasets shown per result page in pagination
datasetsnippets.datasets_per_page = 10
# String used as root element for breadcrumb
datasetsnippets.default_root_breadcrumb = 'Berlin Open Data'
# URL to the datenportal for generating feeds
datasetsnippets.datenportal_url = link_to_portal
# Title string used in feeds
datasetsnippets.datenportal_title = 'Berlin Open Data'
Plugin Interfaces Implemented
- ITemplateHelpers
- IBlueprint
- IAuthFunctions
License
This material is copyright © BerlinOnline GmbH.
This extension is open and licensed under the GNU Affero General Public License (AGPL) v3.0.