Onebox topic previews in the topic list

I’m trying to vaguely replicate the way Facebook deals with hyperlinks for things you post.
Basically they display a Onebox (or similar) preview of the first hyperlink, alongside the first few excerpts of your post.

I’ve had a quick play with the Topic List Previews plugin but that doesn’t seem to do what I’m after.

Is anyone aware of a way to create the behaviour described?

Are you trying to style the Topic List or the Topic?

Have you used the Tiles setting in TLP? This will show a thumbnail and an excerpt (if available) in a ‘facebook’ style way - See example https://rideabl.es

In Discourse the only level the thumbnails are presented in a social media like way is on the Topic List (and requires a plugin or TC to do that, eg TLP, Fakebook or Topic List Thumbnails)

At Topic level you may need to keep with one boxes although it may be possible to style those I’ve never gone down that road.

Thanks. I had not tried the tiled mode - and yes that seems to work. Obviously it’s 3 columns, not one like Facebook, but I presume this can be changed? (although I might leave it as is - could be better!)

On a related note, I tried out the topic list excerpt but this seems to give some odd rendering. For example it displays fully formatted excerpt (including hyperlinks) and also starts to randomly change style (e.g. bigger font) and/or add a leading space. Do you know how I might fix this?

Lastly the rideabl.es has the nice “open externally” icon/hyperlink at the top of the topics. Does your plugin provide this or someone else’s?

The TLP TC (not plugin) is fully responsive, so if you reduce the space by having sidebars, the columns automatically decrease in number (simply decrease the size of the browser to test this), see Which one to install: Plugin or TC? - Topic Previews - Pavilion

See the Layouts plugin to add customisable sidebars. Read more about that: Layouts - Pavilion

Alternatively try Fakebook TC, which is one column all of the time and has some inbuilt sidebars.

topic list excerpt has some issues for all implementations because the serializer is sending a lot of unnecessary junk (e.g. including the onebox anchors!) … this can be styled out to some extent - just did it on rideables.

This is native, just included within TLP’s output.

1 Like

Do you know how I get access to this then? I does not render out on my, basically vanilla, install of Discourse.

Lastly, do you know why the formatting is a bit wonky even for pages where the plugin isn’t enabled? I’ve noticed that the lists/categories that don’t have TLP enabled, they all seem to contain extra padding at the bottom of the topic title in the list views.

It’s built when you put a link in the title (see the placeholder text).

The ‘plugin’ if installed will override templates regardless. If something is wonky try to restyle it (but check impact is acceptable on each style) and perhaps I can update the CSS on the plugin - feel free to PR. You can also raise a bug report here Bug Report.

1 Like

OK, I placed a URL into the topic and see the external link icon now as well as how Discourse has automatically copied the title from the linked resource.

Unfortunately this seems to have stopped the TLP onebox preview. What am I doing wrong?

I’m looking into the Fakebook theme. Thanks for the tip! :ok_hand:

No doesn’t stop it. You need to be patient. Rendering of a thumbnail (actually a set of thumbnails) is a server side process and takes time. It is not instant. This is true across all implementations. Changing the front end will have no effect on this. :).

2 Likes