{%- if record.doi and record.conceptdoi and "doi" in record and (record.doi|doi_locally_managed) %} {%- set pid_versioning = pid | to_versioning_api -%} {# All versions included (published, deleted) #} {%- set all_versions = pid_versioning.get_children(ordered=True, pid_status=None) | list %} {%- set active_versions = pid_versioning.children|list %} {%- set pid_version_index = all_versions.index(pid) %}

{{_('Versions')}}

{%- for pid_version in (active_versions|reverse|list)[:5] %} {%- set version_record = pid_version|record_from_pid %} {%- set current_version_index = all_versions.index(pid_version) %} {%- set version_label = version_record.version or (current_version_index + 1) %} {%- endfor %} {%- if active_versions|length > 5 %} {%- if pid_version_index < active_versions|length - 5 %} {% if pid_version_index < active_versions|length - 6 %}{% endif %} {% endif %} {% set q = {"conceptrecid": record.conceptrecid}|make_query %} {%- endif %}
Version {{ version_label }} {{version_record.doi}} {{ version_record.publication_date|from_isodate|dateformat(format='medium')}}
...
Version {{ pid_version_index + 1 }} {{record.doi}} {{ record.publication_date|from_isodate|dateformat(format='medium')}}
View all {{active_versions|length}} versions
Cite all versions? You can cite all versions by using the DOI {{config.PIDSTORE_DATACITE_DOI_PREFIX}}/{{config.PIDSTORE_DATACITE_DOI_SUFFIX}}/{{pid_versioning.parent.pid_value}}. This DOI represents all versions, and will always resolve to the latest one.
{%- endif %}