Kia ora koutou,
Has anyone played around with Twitter cards and/or Open Graph with Dspace? The
goal being that, if someone tweets a link to an item in the repository, Twitter
(or Facebook or whoever) automatically displays a little preview of the item’s
title, thumbnail etc. This seems likely to improve click-throughs/engagement.
I’ve edited page-structure.xsl (we’re on XMLUI, Mirage2) to get some basic
metadata in – following the Google Scholar Metadata section:
<!-- Add Open Graph tags for
appearance on social media -->
<meta property="og:type"
content="article"/>
<meta property="og:site_name"
content="Research@Lincoln"/>
<meta property="og:image"
content="https://ltl.lincoln.ac.nz/wp-content/uploads/sites/20/2020/01/lincoln.png"/>
<xsl:for-each
select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element = 'title']">
<meta
property="og:title" content="{.}"/>
</xsl:for-each>
<xsl:for-each
select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element =
'identifier']">
<meta
property="og:url" content="https://hdl.handle.net/{.}"/>
</xsl:for-each>
Which experiments on Twitter show works! :)
But note the image is a static logo, and I haven’t managed to get a description
in. This content doesn’t appear to be included in the dri structure – except
that dcterms.abstract is buried in the xhtml_head_item which is a giant
blob-thing of xml as text so I can’t reach into it (unless maybe I play with
substrings). Is there any other way to get at the abstract here?
And is there a way to access the mets data from page-structure.xsl? (If so, I
should be able to get the item’s thumbnail to use for the image.) We have in
item-view.xsl and I don’t see why it wouldn’t be accessible from
page-structure.xsl, but maybe that shows how much I know. In any case so far
all my trial-and-error messing around trying to access it has resulted in
errors.
Ngā mihi,
Deborah
––––––––––––––––––––––––––––––––––
Deborah Fitchett
Head of Department: Digital Services
––––––––––––––––––––––––––––––––––
Library, Teaching and Learning – Te Wharepūrākau
PO Box 85064, Lincoln University
Lincoln 7647, Christchurch, New Zealand
+64 3 423 0358
[email protected]<mailto:[email protected]>
ltl.lincoln.ac.nz
––––––––––––––––––––––––––––––––––
Lincoln University
Te Whare Wānaka o Aoraki
––––––––––––––––––––––––––––––––––
________________________________
"The contents of this e-mail (including any attachments) may be confidential
and/or subject to copyright. Any unauthorised use, distribution, or copying of
the contents is expressly prohibited. If you have received this e-mail in
error, please advise the sender by return e-mail or telephone and then delete
this e-mail together with all attachments from your system."
--
All messages to this mailing list should adhere to the DuraSpace Code of
Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dspace-tech/SYCPR01MB475232A846F2EC2145DBA051C5180%40SYCPR01MB4752.ausprd01.prod.outlook.com.