{% ckan_extends %} {% set pkg_dict = c.pkg_dict %} {% block collection_resources %} {% set identifier = h.get_pkg_dict_extra(c.pkg_dict, 'Identifier', '') %} {% set collection_sourceid = h.get_pkg_dict_extra(c.pkg_dict, 'harvest_source_id', '') %} {% set collection_ispartof = h.get_pkg_dict_extra(c.pkg_dict, 'isPartOf', '') %} {# 1. we check each dataset to see if it is a collection parent using its identifier. if count_collection returns a value other than 0, then we know that this dataset is a collection parent. 2. we use collection_ispartof to tell if this dataset is a collection child. if collection_package returns a dataset, then we know its collection parent is found. #} {% set count_collection = h.count_collection_package(collection_sourceid, identifier) %} {% if count_collection or collection_ispartof %}

{{ _('Collection') }}

{% if count_collection %} {% set collection_info = collection_sourceid ~ ' ' ~ identifier %}

This dataset is a collection of {{ count_collection }} other datasets.

{{ _('Search datasets within this collection') }}

{% endif %} {% if collection_ispartof %} {% set collection_info = collection_sourceid ~ ' ' ~ collection_ispartof %} {% set collection_package = h.get_collection_package(collection_info) %} {% if collection_package %}

{{ _('This dataset is part of the following collection:') }}

{% else %}

{{ _('This dataset is part of a deleted collection.') }}

{{ _('Search other datasets within the same collection') }}

{% endif %} {% endif %}
{% endif %} {% endblock %}