Skip to content

Commit 1e137ef

Browse files
authored
Merge pull request #5621 from QualitativeDataRepository/IQSS-4894-Open_Graph_metadata
use dataset thumbnail if available
2 parents 1f9a682 + cf1e35a commit 1e137ef

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dataverse will use the Dataset thumbnail, if one is defined, rather than the generic Dataverse logo in the Open Graph metadata header. This means the image will be seen when, for example, the dataset is referenced in Facebook.

src/main/webapp/dataset.xhtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
<meta property="og:title" content="#{DatasetPage.title}" />
8787
<meta property="og:type" content="article" />
8888
<meta property="og:url" content="#{DatasetPage.dataverseSiteUrl}/dataset.xhtml?persistentId=#{dataset.globalId}" />
89-
<meta property="og:image" content="#{DatasetPage.dataverseSiteUrl.concat(resource['images/dataverse-icon-1200.png'])}" />
89+
<meta property="og:image" content="#{DatasetPage.dataset.getDatasetThumbnail(ImageThumbConverter.DEFAULT_PREVIEW_SIZE) == null ? DatasetPage.dataverseSiteUrl.concat(resource['images/dataverse-icon-1200.png']): DatasetPage.dataverseSiteUrl.concat('/api/datasets/:persistentId/thumbnail?persistentId=').concat(DatasetPage.dataset.getGlobalId().asString())}" />
9090
<meta property="og:site_name" content="#{DatasetPage.publisher}" />
9191
<meta property="og:description" content="#{(DatasetPage.description.length()>150 ? DatasetPage.description.substring(0,147).concat('...') : DatasetPage.description)}" />
9292
<ui:repeat var="author" value="#{DatasetPage.datasetAuthors}">

0 commit comments

Comments
 (0)