diff --git a/apps/iiif/manifests/models.py b/apps/iiif/manifests/models.py index 31c71600..20cb85d0 100644 --- a/apps/iiif/manifests/models.py +++ b/apps/iiif/manifests/models.py @@ -272,6 +272,27 @@ def related_links(self): }) return links + @property + def external_links(self): + """Dict of lists of external links for display on volume pages + + :return: Dict of external links ("related" and "seeAlso") + :rtype: dict + """ + related_links = self.relatedlink_set.all() + return { + "see_also": [ + link.link + for link in related_links + if link.data_type.lower() == "dataset" + ], + "related": [ + link.link + for link in related_links + if link.data_type.lower() != "dataset" + ], + } + @property def see_also_links(self): """List of links for IIIF v2 'seeAlso' field (structured data). diff --git a/apps/templates/page.html b/apps/templates/page.html index 9df5932b..b07f083b 100644 --- a/apps/templates/page.html +++ b/apps/templates/page.html @@ -430,6 +430,25 @@