CKAN Content¶
Content components are designed to display CKAN's core entities in a consistent
way. Most entities have a singular component (e.g., package) and a list
wrapper (e.g., package_list).
Datasets (Packages)¶
The package component displays information about a single dataset, typically
as a snippet in search results or a list.
Example
package_list
| Parameter | Type | Description |
|---|---|---|
content |
any | Collection of packages |
package
| Parameter | Type | Description |
|---|---|---|
content |
any | Usually ignored |
package |
dict | Dictionary with package details |
Organizations¶
Displays information about a CKAN organization.
Example
organization_list
| Parameter | Type | Description |
|---|---|---|
content |
any | Collection of organizations |
organization
| Parameter | Type | Description |
|---|---|---|
content |
any | Usually ignored |
organization |
dict | Dictionary with organization details |
Groups¶
Displays information about a CKAN group.
Example
group_list
| Parameter | Type | Description |
|---|---|---|
content |
any | Collection of groups |
group
| Parameter | Type | Description |
|---|---|---|
content |
any | Usually ignored |
group |
dict | Dictionary with group details |
Resources¶
Displays information about a single resource within a dataset.
Example
resource_list
| Parameter | Type | Description |
|---|---|---|
content |
any | Collection of resources |
resource
| Parameter | Type | Description |
|---|---|---|
content |
any | Usually ignored |
resource |
dict | Dictionary with resource details |
package |
dict | Dictionary with parent package details |
Users¶
Displays user profile information.
Example
user_list
| Parameter | Type | Description |
|---|---|---|
content |
any | Collection of users |
user
| Parameter | Type | Description |
|---|---|---|
content |
any | Usually ignored |
user |
dict | Dictionary with user details |
Search & Facets¶
Components for filtering and exploring content.
Facets¶
facet components are used to filter search results. They are usually grouped
into a facet_list and further organized into facet_sections.
Example
Facet section¶
facet_section
| Parameter | Type | Description |
|---|---|---|
content |
any | List of facets |
title |
str | Optional title of the facet section |
key |
str | Facet key ("organization", "res_format", etc.) |
has_more |
bool | Whether there are more facet values that can be shown in a "show more" widget. |
Facet list and facet¶
facet_list
| Parameter | Type | Description |
|---|---|---|
content |
any | Collection of search facets |
facet
| Parameter | Type | Description |
|---|---|---|
content |
any | Label of the facet item |
key |
str | Facet key ("organization", "res_format", etc.) |
value |
str | Facet value (organization name, resource format, etc.) |
count |
int | Number of items matching this facet value. |
active |
bool | Whether this facet value is currently active. |
Filters Container¶
A high-level container for all search filters, typically shown in the sidebar.
Example
{%- call ui.util.call(ui.filters) -%}
{%- call ui.util.call(ui.facet_section, title=_("Organizations")) -%}
{%- call ui.util.call(ui.facet_list) -%}
{%- for item in facets -%}
{{ ui.facet(item.display_name, key="organization", value=item.name, count=item.count) }}
{%- endfor -%}
{%- endcall -%}
{%- endcall -%}
{%- call ui.util.call(ui.facet_section, title=_("Tags")) -%}
{%- call ui.util.call(ui.facet_list) -%}
{%- for item in tag_facets -%}
{{ ui.facet(item.display_name, key="tags", value=item.name, count=item.count) }}
{%- endfor -%}
{%- endcall -%}
{%- endcall -%}
filters
| Parameter | Type | Description |
|---|---|---|
content |
any | Collection of facet sections |