[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Open graph Tags



Hi John,

Thanks for the tip. I've been looking at that page this morning since my
hacky way of getting the tags to work has come back to bite me.

Ultimately, I had to go to "Facebook for Developers" and clear the cache
and "scrape" the repository again (it hadn't been done since the start of
Feb). The reason the abstracts were working is because they had never been
scraped so loaded up my new tags without using the cache. It appears just
putting them in the default.xml template was enough.

Now I'm having fun with "Twitter Cards" - the Twitter equivalent to og
tags. Unfortunately, I think I need to take a step back and add these tags
to the <head> in a different way as in each case the tags need access to
variables such as EPrint titles, abstracts etc.

I'll get there in the end.

Thanks for you help,
James

On Thu, Feb 28, 2019 at 4:51 PM John Salter via Eprints-tech <
eprints-tech at ecs.soton.ac.uk> wrote:

> Hi James,
>
> How are you including the tags in the index.xpage?
>
>
>
> If you're adding them to the <xpage:body>, then this might be useful:
>
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FAPI%3AEPrints%2FApache%2FTemplate%23Static_HTML_Pages&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cc964a4467de44e33554008d69e414876%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=4fo1p2V%2Bts2g75KbQ6slss4NbpXwSeuhw9z0YauTQco%3D&amp;reserved=0
> <https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FAPI%3AEPrints%2FApache%2FTemplate%23Static_HTML_Pages&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cc964a4467de44e33554008d69e414876%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=4fo1p2V%2Bts2g75KbQ6slss4NbpXwSeuhw9z0YauTQco%3D&amp;reserved=0>
>
>
>
> There's an <xpage:head> which will get added to the template in the <head>
> area - which might be what you need?
>
>
>
> Cheers,
>
> John
>
>
>
>
>
> *From:* eprints-tech-bounces at ecs.soton.ac.uk [mailto:
> eprints-tech-bounces at ecs.soton.ac.uk] *On Behalf Of *James Kerwin via
> Eprints-tech
> *Sent:* 28 February 2019 16:33
> *To:* eprints-tech at ecs.soton.ac.uk
> *Subject:* [EP-tech] Open graph Tags
>
>
>
> Hi All,
>
>
>
> Has anybody attempted to use Open Graph tags in EPrints to facilitate
> sharing links on social media?
>
>
>
> I'm attempting it now and I can get it to work on EPrint abstracts, but
> not on the repository home page. On the latter I'm getting a title
> different to my test title and an image that isn't the one I stipulate.
>
>
>
> For example, my Test versions of the og tags are:
>
>
>
> <meta property="og:title"  content="zebra"/>
>
> <meta property="og:image" content="
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.liverpool.ac.uk%2Fmedia%2Flivacuk%2Fliverpool-advantage.jpg&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cc964a4467de44e33554008d69e414876%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=1nAZ%2FGFU4BPxNbkFUrj3eEPjsaqBI7rQZaZfsuRnuLY%3D&amp;reserved=0
> <https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.liverpool.ac.uk%2Fmedia%2Flivacuk%2Fliverpool-advantage.jpg&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cc964a4467de44e33554008d69e414876%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=1nAZ%2FGFU4BPxNbkFUrj3eEPjsaqBI7rQZaZfsuRnuLY%3D&amp;reserved=0>
> "/>
>
>
>
> I have included these in my default.xml template. This allows the link to
> be shown with the correct title and image for abstracts. Unfortunately it
> doesn't work for the home page, so I inserted these tags into my
> index.xpage which doesn't seem to have worked either. When sharing a link
> to the home page it shows me the title of the page that exists between the
> <title></title> tags in default.xml and the first image that occurs in
> index.xpage.
>
>
>
> I've tried putting the OG tags in different places, restarting the server
> after changes and removing the previously mentioned <title></title> tags to
> see what happens and no success so I'm assuming it might be a quirk of
> EPrints? Or am I putting these in the wrong place? I appreciate it's a
> broad question as we all have different tags etc in our various files, but
> if anybody can shed any light on this I would be really grateful.
>
>
>
> When I started this earlier I thought it wouldn't take long as it's not
> particularly difficult, how wrong I was!
>
>
>
> Thanks,
>
> James
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cc964a4467de44e33554008d69e414876%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=xOmLoTjZBow%2Fys%2BkdU306jRoY3ZhQ1ucPfo1ma49TC0%3D&amp;reserved=0
> *** EPrints community wiki: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cc964a4467de44e33554008d69e414876%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=FpAkVGLrDkDR%2B6DpeGSnGhltfhwUUQi%2BkHcV0nE92KM%3D&amp;reserved=0
> *** EPrints developers Forum: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cc964a4467de44e33554008d69e414876%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=k9a3tkFhTloW0pC4NCkeczO6vvrxkpQwXo4zpUIrc84%3D&amp;reserved=0
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20190301/7ef6fb6e/attachment.html