Get started with ckan CDN

MIT licensed

CKAN is a library for building interactive data explorers and forms, commonly used for managing and accessing data in the CKAN data repository system.

Tags:
  • Javascript
  • Catalog
  • DataStore API

Stable version

Copied!

How to start using ckan CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with ckan CDN - cdnhub.io</title>
    <script src="https://cdn.cdnhub.io/ckan/0.2.3/ckan.min.js"></script>
    <script>
        // Initialize CKAN
        ckan.init({
            apiKey: 'your_api_key', // Replace with your CKAN API key
            ckanBaseUrl: 'http://your_ckan_instance.com', // Replace with your CKAN instance URL
            searchBoxSelector: '#search-box', // ID of the search box element
            resultsContainerSelector: '#search-results', // ID of the container for search results
            resultsPerPage: 10, // Number of search results to display per page
            autocomplete: true // Enable autocomplete feature
        });

        // Initialize search box
        document.addEventListener('DOMContentLoaded', function() {
            var searchBox = document.getElementById('search-box');
            ckan.searchBox(searchBox);
        });
    </script>
</head>
<body>
    <input type="text" id="search-box" placeholder="Search...">
    <ul id="search-results"></ul>
</body>
</html>
Copied!
Copied!
Copied!

All versions