Implemented URL unfurling for ePer

Currently reading:
Implemented URL unfurling for ePer

Joined
Jul 14, 2020
Messages
383
Points
218
Location
Wiltshire
If you look at this post:
the forum software has displayed a preview of the eBay link but not the ePer link. Might it be nice to have a similar preview for ePer links? I couldn't quickly see what information xenForo wants ePer to provide but I'm happy to update the metadata from ePer to give what is needed. I get the feeling that the results are cached in the forum so this wouldn't resolve old posts but would do work for new links posted
 
This suggestion has been implemented. Votes are no longer accepted.
To, partly, answer my own question. Looks like we need to support og meta tags

Using info gleaned from here Medium info
I stubbed up some html with og meta tags and that now shows a reasonable preview in the unfurl dialog
<!DOCTYPE html>
<html lang="en" class="h-100">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:url" content="https://eper.fiatforum.com/en/Drawings/Detail/F/F/BAR/PK/501/ALL/ALL/0/Group" />
<meta property="og:title" content="50101/00 - HEAT AND VENTILATION SYSTEM - FIAT BARCHETTA (1995-2004) | FIAT ePER - Online spare parts catalogue" />
<meta property="og:description" content="50101/00 - HEAT AND VENTILATION SYSTEM" />
<meta property="og:site_name" content="ePer" />
<meta property="og:image" content="https://data-84-eper.fiatforum.com/54/54AEF1D27F862A88E20785678935CC28.png" />
<title>FIAT BARCHETTA (1995-2004) | FIAT ePER - Online spare parts catalogue</title>
</head>
<body>
Hello from the web
</body>
</html>

We get a preview that looks like this (URL redacted as it's some private server I don't want to share!):
1708855537186.png

With a bit of fine tuning that could work?
 
If you look at this post:
the forum software has displayed a preview of the eBay link but not the ePer link. Might it be nice to have a similar preview for ePer links? I couldn't quickly see what information xenForo wants ePer to provide but I'm happy to update the metadata from ePer to give what is needed. I get the feeling that the results are cached in the forum so this wouldn't resolve old posts but would do work for new links posted
I think there should be enough variable data in the template already to do this without further controller changes?

I'll have a look at this tomorrow 👍
 
I think there should be enough variable data in the template already to do this without further controller changes?

I'll have a look at this tomorrow 👍
That was my gut feel, it's mostly the page title and possibly a logo, car image or whatever drawing is being displayed on the page. If you need anything else returned in the ViewModel then shout. Good luck!
 
  • Like
Reactions: ben
Minor, pedantic, point but we're not getting a favicon next to the URL. Not sure whether it needs another tag for that or should just get it from the site.
Should have been picked up, but for some reason it wasn't. Have added the tag now to make sure :)
 
Back
Top